12/11 what is food?


#1

This is my code. I keep getting the error
"Traceback (most recent call last):
File "python", line 19, in
NameError: name 'food' is not defined"
I don't really get where food came rom either O.o

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 item in food: < this is line 19
if stock[food] > 0:
total += prices[item]
stock[food] - 1
print total

**Thanks much! :)**

#2
if stock[food] > 0:
stock[food] - 1

You should be referencing the item in food
Use stock[item] instead