Challenge "Ballpark order"/Python what is wrong? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Challenge "Ballpark order"/Python what is wrong?

Can someone tell me what's the mistake here? I can't find what's wrong with this code test 1 and 2 passed, the hidden ones are wrong order=input() order = order.split(" ") total_cost = 0.00 for item in order: if item =='Water': total_cost+=4 elif item =='Cheeseburger': total_cost+=10 elif item =='Nachos': total_cost+=6 elif item =='Coke': total_cost+=5 elif item =='Pizza': total_cost+=6 else: total_cost+=5 total_cost *=1.07 print(total_cost)

19th Mar 2023, 11:23 PM
Ak Le
Ak Le - avatar
2 Answers
+ 3
Ak Le #print(total_cost) x = "{:.2f}".format(total_cost) print(x)
20th Mar 2023, 3:53 AM
A͢J
A͢J - avatar
+ 1
Thank you!
20th Mar 2023, 11:11 AM
Ak Le
Ak Le - avatar