this error keeps plaguing me
with the code:
option = input('What would you like to do? ') if option == 1: newExpence = addExpence(totalBudget) totalBudget = totalBudget - newExpence elif option == 2: removedExpence = removeExpence(totalBudget) totalBudget = totalBudget + removedExpence elif option == 3: newRevenue = getNewRevenue() totalBudget = totalBudget + newRevenue elif option == 4: removeRevenue = doremoveRevenue(totalBudget) totalBudget = totalBudget - removeRevenue elif option == 5: print "Thank you for using our program" else: print "Input not recognized, please try again"
if my user accidentally hits say "r" my whole program crashes instead of printing "Input not recognized, please try again" nowhere in my program are letters acceptable, how can i limit user input to only using decimal numbers?