TypeError: unhashable type: 'list'


#1

I am having trouble as well.
My error is:
compute_bill(['apple']) resulted in a TypeError: unhashable type: 'list'

Code:

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 n in food:
        total + prices[shopping_list]
    return total

#2

this line:

total + prices[shopping_list]

shopping_list is a list, it doesn't hold the key to access the dictionary. what does hold the key? n does (thanks to the for loop)