0

What is wrong with my code (Ballpark Orders)

This is my code for the "Ballpark Orders" task in code coach. Can anybody help me? order = input() order = order.split(" ") tax = 0.07 cost = 0 for i in order: if i == "Water": cost += 4 elif i == "Cheesburger": cost += 10 elif i == "Nachos" or i == "Pizza": cost += 6 else: cost += 5 print(cost+(cost*tax))

26th Mar 2022, 2:20 AM
David Lau
David Lau - avatar
4 Answers
+ 2
It would not hurt to know the task đŸ€”
26th Mar 2022, 2:38 AM
Solo
Solo - avatar
+ 1
Oh, that's true 😅 Here it is: 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
26th Mar 2022, 2:41 AM
David Lau
David Lau - avatar
+ 1
Oh no... idiot me... I've found the mistake by myself - it was just a spelling mistake in "cheeseburger". Thank you for your attention everyone â˜ș
26th Mar 2022, 2:45 AM
David Lau
David Lau - avatar
+ 1
You see how sometimes it is useful to carefully reread the task â˜ș
26th Mar 2022, 2:50 AM
Solo
Solo - avatar