Stocking out


error message: calling compute_bill with a list containing 1 pear, 3 oranges and 9 bananas resulted in 43.5 instead of the correct 31.5

I don't now why it doesn't work

Replace this line with your code. 
def compute_bill(food):
    for key in food:
        if stock[key]>0:
            total =total+prices[key]
            stock== stock[key]-1
    return total


this line:

stock== stock[key]-1

why use two equal signs? It means check if equal, why would do this here?

Make sure to reduce the stock of product correctly


Thanks a lot! It worked!