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!
4 odpowiedzi
+ 2
this finally worked for me, thanks everyone
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.
0
tried replacing the space , didnt work. Why would i have to change the total line? Thanks everyone!
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))