11/13 doubts


#1

https://www.codecademy.com/courses/learn-python/lessons/a-day-at-the-supermarket/exercises/making-a-purchase?action=lesson_resume
<In what way does your code behave incorrectly? Include ALL error messages.>
I solved 11/13 but in the instruction it says that it has to work with all do lists. How can I do that

```

Write your code below!

shopping_list = [“banana”, “orange”, “apple”]

stock = {
“banana”: 6,
“apple”: 0,
“orange”: 32,
“pear”: 15
}

prices = {
“banana”: 4,
“apple”: 2,
“orange”: 1.5,
“pear”: 3
}

def compute_bill(numbers):
total = 0
for number in numbers:
total += prices[number]
return total


#2

oh sorry, I misunderstood the instructions


#3

You understand now? Your function works for any list supplied as argument on function call, because the argument at function call gets passed to the function parameter (numbers), which you use in the loop, which is good :slight_smile:


#4

Yes, I understood… Sometimes I get confused with loops and functions :sweat_smile:


#5