+ 2
Project question
I'm working on a little test code but keep getting operator errors due to my if statement conditions. what's the error I'm making here? total = input("What is your shopping total?") if (total > 1000): discount = total * 0.1 truetotal = total - discount print (truetotal) else: print (total)
2 Antworten
+ 5
input in Python is automatically string format, so you first need to convert it to a real number with int(total) or float(total).
+ 1
thanks so much Shifu