Ballpark orders - how can I find my mistake? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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?

21st Nov 2022, 9:59 PM
darkno1
darkno1 - avatar
7 Answers
+ 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.
21st Nov 2022, 10:30 PM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Hey Per Bratthammar! It was the round command missing. Already solved! Thanks again!
21st Nov 2022, 10:48 PM
darkno1
darkno1 - avatar
+ 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.
21st Nov 2022, 10:33 PM
Per Bratthammar
Per Bratthammar - avatar
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
21st Nov 2022, 10:34 PM
darkno1
darkno1 - avatar
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))
21st Nov 2022, 10:42 PM
Per Bratthammar
Per Bratthammar - avatar
0
Thanks!
21st Nov 2022, 10:45 PM
darkno1
darkno1 - avatar