Whats the issue?


#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:
total=prices+total
print total

small=compute_bill(shopping_list)
print small


#2

Your whitespace is wrong, correct code:

def compute_bill(food):
    total=0
    for item in food:
        total=prices+total
    print total

small=compute_bill(shopping_list)
print small

#3

I get this error...
Traceback (most recent call last):
File "python", line 25, in
File "python", line 22, in compute_bill
TypeError: unsupported operand type(s) for +: 'dict' and 'int'