0
Ballpark orders challenge in the code coach, I'm stuck in it, i don't know how to use the for loops to solve it, help please.
Python basics https://code.sololearn.com/ckCvf9s0W3va/?ref=app
6 Respuestas
+ 3
1. Never use existing names to name new functions (or variables, classes, or anything else). "def list" overwrites existng class "list", what can get you weird and hard to debug issues. Use unique and descriptive names instead.
2. If you want to convert the string into a list, study function "split" again. Hint: it already retuns a list, no further processing required.
3. Your "list" function does nothing. I recommend studying again the lessons on functions.
4. You need to include, in your code, the relationship between items and values. This will allow you to replace words with prices. How do you intend to include this data?
After this, we can move to the conversion part.
+ 2
Can you please add the task?
Your code isn't finished. Also, python's input is automatically a string, so trying to convert it to a string doesn't help.
+ 1
You've added the input, Water etc, but not what you need to do.
Copy the question/task.
0
Yes, I'm sorry, the input is
Water
Coke
Cheeseburger
Pizza
0
Strings formed of these words, in the task they need me to replace these words with their prices, and then sum them and add the taxes
0
I converted the input to list, and split them by commas, because they were separated by spaces, now I need to use the for loops to convert the list of strings to a list of numbers (the prices) and then sum them and add the taxes