49.9k views
17 votes
How would i change this:

" try:
userChoice = input("Would you like to Add or Multipy?(A/M): ")
except:
print("Please enter 'A' or 'M'") "

so it only allows me to put "A" or "M" so that it runs the except part

User LazyEval
by
3.2k points

1 Answer

3 votes

You wouldnt use a try and except statement. Use a loop.

How would i change this: " try: userChoice = input("Would you like to Add-example-1
User Angely
by
3.9k points