After a helping hand to get me to understand the previous module, I'm now very confused about the next one, #12. Stocking Out
When I run the code below I see this error:
Traceback (most recent call last):
File "python", line 26, in
File "python", line 22, in compute_bill
TypeError: unhashable type: 'list'
but I don't understand why.
def compute_bill(food): total = 0 for fruit in food: if stock[fruit] > 0: total = total + prices[food] stock[food] = stock[food]-1 return total