11/13 doubts


<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


oh sorry, I misunderstood the instructions


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:


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