Part 11 help


#1



https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/2/2?curriculum_id=4f89dab3d788890003000096

This is the message that keeps on popping up when I put in the code: Oops, try again. compute_bill(['apple']) returned 7.5 instead of 2


shopping_list = ["banana", "orange", "apple"]

stock = {
    "banana": 6,
    "apple": 0,
    "orange": 32,
    "pear": 15
}
    
prices = {
    "banana": 4,
    "apple": 2,
    "orange": 1.5,
    "pear": 3
}

# Write your code below!
def compute_bill(food):
    total = 0
    for food in shopping_list:
        total += prices[food]
    return total


#2

HI the instruction says

For each item in the food list, add the price of that item to total so your for loop should be something like that

for key in food:
.....

key could be any other word you want


#3

I tried this

def compute_bill(food):
total = 0
for item in food:
total += prices[item]
return total

this worked for me