0

Ballpark stank

I am getting 29.96 as answer to second test case with 29 being the total before tax order = input().split() sum = 0 for i in order: if i == 'Cheeseburger': sum += 10 elif "Water": sum += 4 elif "Nachos": sum += 6 elif "Pizza": sum += 5 elif "Coke": sum += 5 else: sum += 5 print(sum + (sum * 7/100))

6th Jul 2021, 7:02 PM
Lee 4 Code
Lee 4 Code - avatar
5 ответов
+ 3
You forgot to compare with i in elif.
6th Jul 2021, 8:21 PM
Solo
Solo - avatar
+ 2
Pizza and Nachos have same prices elif i== "Nachos": sum += 6 elif i== "Pizza": sum += 6
7th Jul 2021, 1:14 AM
Simba
Simba - avatar
+ 1
simple errors Thanks Vasiliy!
6th Jul 2021, 9:20 PM
Lee 4 Code
Lee 4 Code - avatar
+ 1
Show the assignment
6th Jul 2021, 10:55 PM
Solo
Solo - avatar
0
i == "": sum += 5
6th Jul 2021, 11:07 PM
Lee 4 Code
Lee 4 Code - avatar