0
Ballpark orders - how can I find my mistake?
All visable test cases are right and all hidden test cases are wrong. So how can I find my mistake?
7 Réponses
+ 3
You can post the task here and copy your code attempt into the code playground and attach that here too.
Maybe you're not thinking of some possible answers that could eventuate and that's why those hidden cases are there.
+ 2
Hey Per Bratthammar! It was the round command missing. Already solved! Thanks again!
+ 1
Hi, darkno1 !
One idea is to try the code in playground with different value. Maybe you can find out what input cause the wrong output.
Start three. I no success, link the code here and ask for help.
0
This 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
# Hi, darkno1
# You can compare your solutions to this code.
print(round(1.07 * sum({"Nachos": 6, "Pizza": 6, "Cheeseburger": 10, "Water": 4}.get(i, 5) for i in input().split()), 2))
0
Thanks!