[Tutor] if then statements
Jacqueline G Solis
jsolis1 at stedwards.edu
Wed Apr 29 03:24:57 CEST 2015
hello,
I keep getting a syntax error. Could you please explain why that happens and how to correct it.
def main ():
print( "Welcome to Gonzo Burger!")
order= int(input("Enter 1 if you want a hamburger,\
or 2 if you want a cheeseburger:" ))
if order == 1 :
print("order: 1")
else:
print("Order: 2")
drink=int(input("Thank you! Next, enter a 1 if you want a Coke,\
or a 2 if you want a Sprite:")
if drink == 1 :
print("Order: 1")
else:
print("Order: 2")
print("Thank you! You ordered:")
if order == 1:
print("- Hamburger")
else:
print("- Cheeseburger")
if drink == 1 :
print("- Coke")
else:
print("- Sprite")
main ()
-Jackie
p.s: the error happens in the second if statement.
More information about the Tutor
mailing list