12/13 Problem


I keep getting this same error message and not sure what to fix.

Any advice would be awesome.


Sorry, the error message says: calling compute_bill with a list containing 1 apple, 1 pear, and 1 banana, resulted in 0 instead of the correct 7


You do not need the else block in the implementation.

def compute_bill(food):
    total = 0 
    for item in food:
        if stock[item]> 0:
            total += prices[item]
            stock[item] -= 1
    return total