python ballpark problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

python ballpark problem

order = input().split(' ') total = 0 menuitems = ["Pizza", "Cheeseburger", "Coke", "Water", "Nachos"] for word in order: if word == "Coke": total += 5 elif word == "Pizza": total += 6 elif word == "Nachos": total += 6 elif word == "Water": total += 4 elif word == " Cheeseburger": total += 10 else: total += 5 print(total * 1.07) This still doesnt work....argh why. Ty!

29th Feb 2020, 6:14 PM
Brenner Pieszak
Brenner Pieszak - avatar
4 Answers
+ 2
this finally worked for me, thanks everyone
29th Feb 2020, 7:39 PM
Brenner Pieszak
Brenner Pieszak - avatar
0
You should print total with two decimals. Edit: Even though I checked description and it is not written that anymore. But in my solution/s I rounded to two decimal places because it was in the description before.
29th Feb 2020, 6:27 PM
Mihai Apostol
Mihai Apostol - avatar
0
tried replacing the space , didnt work. Why would i have to change the total line? Thanks everyone!
29th Feb 2020, 7:08 PM
Brenner Pieszak
Brenner Pieszak - avatar
0
order = input().split(' ') total = 0 menuitems = ["Pizza", "Cheeseburger", "Coke", "Water", "Nachos"] for word in order: if word == "Coke": total += 5 elif word == "Pizza": total += 6 elif word == "Nachos": total += 6 elif word == "Water": total += 4 elif word == "Cheeseburger": total += 10 else: total += 5 total = total * 1.07 print(round(total, 2))
29th Feb 2020, 7:39 PM
Brenner Pieszak
Brenner Pieszak - avatar