+ 1

Coach problem on python

Ballpark problem, I'm getting the right answers for test 1 and test 2 but it doesn't pass other test https://www.sololearn.com/coach/15?ref=app Here is my code, please help me understand where I did wrong, thanks foodprice = {"Coke":5,"Water":4,"Cheeseburger":10,"Nachos":6,"Pizza":6} fo = input() foodname = fo.split() total = 0 for food in foodname: if food in foodprice: total += foodprice[food] else: total += 5 print(total*1.07)

25th Sep 2020, 2:53 AM
WENy Z
WENy Z - avatar
1 Answer
+ 2
Wen Yao Zhang Hey, I see you were able to solve the problem by yourself. Well done! I'm posting this here to let others know. Don't doubt to ask again when you need help. Keep rocking!
25th Sep 2020, 3:58 AM
Kevin â˜