+ 1

I don't know what is wrong with it?!

maximum_vaLue = float (199.9) minimum_value = float(2.2) price = float(1.99) def cheese_order(): user_order = float(input("enter ur order mount :")) if user_order < minimum_value: print ("ur amount's less than the minimum. pls enter a higher amount. ") elif user_order > maximum_value: print("ur amount's more than our maximum, pls enter a less amount. ") elif user_order.isdigit(): return print(" the price is", price ,"*", user_order ,"=", price * user_order) else: print("pls enter the amount in digit & try again. ")

8th Jun 2020, 6:19 PM
omar
1 ответ
+ 2
you create a variable "maximum_vaLue" and then refer to "maximum_value" which are not the same isdigit() is only for strings not floats and should be done first thing when taking user input before converting to float
8th Jun 2020, 6:41 PM
JME