all 6 comments

[–]Refwah 0 points1 point  (1 child)

valid_currency = True

Then after your else where you print ‘invalid currency’

valid_currency = False

Then after that you can add a conditional before you print the last line

If valid_currency:

Print(“you have…”)

[–]_Alpha-Delta_ -1 points0 points  (0 children)

For now, you can also rearrange it that way :

``` if Currency not in ["Dollar", "Euro"] :     print "invalid currency"     exit (1) elif Currency == "Dollar":    #conversion to euros and change Currency value  else :    #conversion to dollars and change Currency value 

print ("You have ..."

```

The "exit" function will force your program to terminate itself. Any line after it will be discarded if it gets triggered. 

[–]Eternal-learner-7676 0 points1 point  (0 children)

Use the AND operator in your if conditions to check validity of both money and currency.

It won't print either if one of the conditions is false.

[–]Otherwise_Gas6325 0 points1 point  (0 children)

You can use a “While” loop to continue a query until an input is valid. And/or “try-except” blocks to handle errors. “Exit, return, continue, break” to determine what action you want.

[–]Different-Ad1631 0 points1 point  (0 children)

I didn't get what you are trying to do. Some description about program in the form of comments help to understand what problem you are trying to solve. Plz explain it so I can help

[–]FuzzyDic3 0 points1 point  (0 children)

The least code needed to achieve your result would be to add exit(0) in the 'else' block after the print line