[11/13] TypeError: unhashable type: 'list'


#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
}

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

I have tried every code on this forum here, but I cannot work out how to fix this.

Oops, try again.
compute_bill(['apple']) resulted in a TypeError: unhashable type: 'list'

#2

this line

total += prices[food]

should rather be

total += prices[x]