What am i doing wrong?


#1

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:
     price+=total[item]
    
    return total

#2

here:

price+=total[item]

you want to add the price of item to total, currently you add the total of item to price.


#3

Thank you. it worked.


#4