We are given a string with four items of an order and we have to calculate its price. My code fails one of the tests. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

We are given a string with four items of an order and we have to calculate its price. My code fails one of the tests.

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 Copy to MWE here : https://code.sololearn.com/cttO263CmFNR/?ref=app Please let me know if I posted correctly

2nd Sep 2021, 12:52 PM
Thiago Silva
Thiago Silva - avatar
7 Answers
+ 7
Can you plz copy the question link here
2nd Sep 2021, 1:32 PM
Aysha
Aysha - avatar
+ 6
This is the pro content. Non pro users can't access it. Plz copy the question
2nd Sep 2021, 1:37 PM
Aysha
Aysha - avatar
+ 2
Hi Thiago! I made this code to help someone here for the same challenge. I think your problem is that you misspelled Nachos. Here it is my code. https://code.sololearn.com/c4uPcJSy3Be2/?ref=app
3rd Sep 2021, 4:44 PM
Python Learner
Python Learner - avatar
+ 2
Hey thanks, you nailed it! Works fine now, thanks again!
3rd Sep 2021, 4:48 PM
Thiago Silva
Thiago Silva - avatar
+ 1
Thanks Ipang, Tashi and Aysha!
2nd Sep 2021, 2:02 PM
Thiago Silva
Thiago Silva - avatar
+ 1
I feel very stupid right now hahahaha
3rd Sep 2021, 4:48 PM
Thiago Silva
Thiago Silva - avatar
0
Will do, sorry!
2nd Sep 2021, 1:33 PM
Thiago Silva
Thiago Silva - avatar