0

Is there any errors in it that makes my test cases to fail?

a = input().split(" ") b = {'Nachos':'6.00','Pizza':'6.00','Cheeseburger':'10','meal':'10','Water':'4.00'} r = 0 for i in a: g = b.get(i,'5.00') r = r+float(g) print(r+1.75) 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 Explanation Because Popcorn is not on the menu, this friend gets a coke which brings the subtotal to $25.00 and $26.75 with tax.

23rd Jul 2021, 5:29 AM
Shahir
Shahir - avatar
6 odpowiedzi
0
a = input().split(" ") b = {'Nachos':'6.00','Pizza':'6.00','Cheeseburger':'10','Meal':'10','Water':'4.00'} r = 0 for i in a: g = b.get(i,'5.00') r = r+float(g) print(r+(7/100)) Is it correct now??
23rd Jul 2021, 5:57 AM
Shahir
Shahir - avatar
0
Sorry I forgot!
23rd Jul 2021, 6:14 AM
Shahir
Shahir - avatar
0
a = input().split(" ") b = {'Nachos':'6.00','Pizza':'6.00','Cheeseburger':'10','Meal':'10','Water':'4.00'} r = 0 for i in a: g = b.get(i,'5.00') r = r+float(g) print((r*7)/100+r) Now???
23rd Jul 2021, 6:20 AM
Shahir
Shahir - avatar
0
What makes the difference between them?
23rd Jul 2021, 6:21 AM
Shahir
Shahir - avatar
0
😃😃😆😆
23rd Jul 2021, 6:23 AM
Shahir
Shahir - avatar