How do I connect these lines of code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I connect these lines of code?

I'm still making the restaurant simulator and I've run into another issue. I'm sorry to ask again. waffles=4 eggs=3 french_toast=6 apple_juice=2 orange_juice=2 tea=3 tax=0.40 The program says that the colon is an invalid syntax. V beverage_choice=input("What drink would you like") : [this colon] if input("Orange Juice"): print (orange_juice) elif input("Apple Juice"): print (apple_juice) elif input("Tea"): print (tea) elif input("Neither"): print (Neither) (just multiplying the food together): costofWaffles=waffles*qofwaffles costofEggs=eggs*qofeggs costofFrench_Toast=french_toast*qoffrench_toast costofApple_Juice=apple_juice costofOrange_Juice=orange_juice costofTea=tea Should I put them all together, (like instead of the "/" I put a +) or is there a different code I can I use? subtotal=costofWaffles+costofEggs+costofFrench_Toast+costofApple_Juice/costofOrange_Juice/costofTea total_balance_due=subtotal+tax Also, thank you for the suggestion on the previous post, it worked! (If it helps anyone, I just post the restaurant simulator code itself. )

27th Jul 2020, 1:30 AM
Makala nash
Makala nash - avatar
2 Answers
+ 1
if beverage_choice=="Orange Juice": #Carry on with this way
27th Jul 2020, 4:08 AM
Baratov Hojiakbar
Baratov Hojiakbar - avatar
+ 1
You dont need to use colon after assignments, also, in every condition you are asking for a new user entry. Maybe what you need is: if beverage_choice=='Orange Juice': . . .
27th Jul 2020, 5:15 AM
David Rios
David Rios - avatar