Code challenge ball park order: why this code from me do not work? :( | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Code challenge ball park order: why this code from me do not work? :(

#Nachos and Pizza both cost $6.00. A Cheeseburger meal costs $10. Water is $4.00 and Coke is $5.00. Tax is 7%. lst = str(input()).split() dict = {"Nachos":6, "Pizza": 6, "Cheeseburger":10, "Water":4, "Coke":5} money = 0 for i in lst: if i in dict: money += int( dict[i] ) else: money += 5 money *= 1.07 print(money)

14th Jul 2023, 4:18 PM
Hieu Le Chi
Hieu Le Chi - avatar
3 Answers
+ 9
Hieu Le Chi , You have to round off the value to two decimal places....as in sample output... https://code.sololearn.com/caK67E3Dx3xd/?ref=app
14th Jul 2023, 5:49 PM
Riya
Riya - avatar
+ 7
Try rounding the result to 2 decimals as shown in the example. Compare the public test cases carefully with your own result.
14th Jul 2023, 4:28 PM
Tibor Santa
Tibor Santa - avatar
+ 3
Thank you :)
15th Jul 2023, 1:18 AM
Hieu Le Chi
Hieu Le Chi - avatar