0

Please help me with this, like how the actual (f-nuclear bomb) do I do this Ballpark orders code coach!?!?!?

Can y'all fix the 7% tax and not adding up issue? https://sololearn.com/compiler-playground/cTBQ1el50m21/?ref=app This is what chatgpt says: Orders = input("") Cost = 0.00 # Check each item and add to the cost if "Pizza" in Orders: Cost += 6.00 if "Cheeseburger" in Orders: Cost += 10 if "Water" in Orders: Cost += 4 if "Coke" in Orders or "Popcorn" in Orders: # Assuming "Popcorn" is an unrecognized item Cost += 5 if "Nacho" in Orders: Cost += 6 # Apply tax New_Cost = Cost * 1.07 # Print the final cost, rounded to 2 decimal places print(f"{New_Cost:.2f}")

8th Aug 2024, 5:15 PM
SatyaPrakash Mishra
SatyaPrakash Mishra - avatar
5 ответов
+ 1
Hello, I solved this today. I used a function that is not taught in the course. My first two lines of code are as follows: order = input() splitted = order.split(" ") then I use an iteration to sum the prices. Hope this helps or gives you some ideas.
9th Aug 2024, 5:04 PM
Ruben
+ 4
You won't benefit from the task when you let chatGPT do it. 1. There can be more than one of the same items in the input 2. You do not handle orders that are not in the menu
8th Aug 2024, 5:31 PM
Lisa
Lisa - avatar
+ 4
Complete the python course then go back to it.
8th Aug 2024, 6:09 PM
Chris Coder
Chris Coder - avatar
+ 1
Lisa , I just got angry from trying todo this over and over again and had no idea what the hell the error was so I asked chatgpt to see if it can do something.
8th Aug 2024, 7:01 PM
SatyaPrakash Mishra
SatyaPrakash Mishra - avatar
0
Ruben , Thanks!
10th Aug 2024, 1:13 AM
SatyaPrakash Mishra
SatyaPrakash Mishra - avatar