Stocking Out


#1


Help I dont know whats wrong


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 item in food:
        if stock[food]>0:
            total += prices[food]
            stock[item] -=1
    return total


#2

What is the role of food in this line? ...

for item in food:

... and from where does the variable, item, derive its values?

Considering the above, how should you use item in the lines that follow?


#3

thanks i get it know


#4