Apr-27-2017, 04:12 AM
I am keep getting an error if I put in something other than an integer. I want the loop to reiterate if say enter is pushed or if a letter is input. I want to give the user the error message I put in the else statement and return back to asking for the input again. Thank you.
However if I hit enter or put in a letter it gives this error
pizza_high = 0 while not repeat: pizza_high = int(input('How many pizzas would you like to order:')) if pizza_high != int: repeat = True else: print('**ERROR** Please use whole numbers only!!') pizza_high = 0 for x in range(0, pizza_high): print('pizzas')This is the input if "5" was selected, it works properly.
How many pizzas would you like to order: 5 pizzas pizzas pizzas pizzas pizzas
However if I hit enter or put in a letter it gives this error
How many pizzas would you like to order: t ValueError: invalid literal for int() with base 10: ';'