0
Can you find mistake in my code?
menu = {"Pizza":6, "Nachos":6, "Cheeseburger":10, "Water":4, "Coke":5} order = input().split() bill = 0 for i in order: if i in menu: bill += menu[i] else: bill += menu["Coke"] print(bill*(1.07))
4 Respuestas
+ 4
Output should be rounded to 2 decimals.
print(round(bill*(1.07),2))
+ 1
What's the task?
Why do you add "Coke" if I is not in menu?
+ 1
Lisa here is the task
You and three friends go to a baseball game and you offer to go to the concession stand for everyone. They each order one thing, and you do as well. Nachos and Pizza both cost $6.00. A Cheeseburger meal costs $10. Water is $4.00 and Coke is $5.00. Tax is 7%.
Task
Determine the total cost of ordering four items from the concession stand. If one of your friend’s orders something that isn't on the menu, you will order a Coke for them instead.
Input Format
You are given a string of the four items that you've been asked to order that are separated by spaces.
Output Format
You will output a number of the total cost of the food and drinks.
Sample Input
'Pizza Cheeseburger Water Popcorn'
Sample Output
26.75
0
I think it's something about the taxes.
Is there any hint if they apply to all items on the menu the same?