Stocking out


#1



https://www.codecademy.com/en/courses/python-beginner-en-IZ9Ra/2/3?curriculum_id=4f89dab3d788890003000096


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):
    total=0
    for key in food:
        if stock[key]>0:
            total =total+prices[key]
            stock== stock[key]-1
    return total


#2

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


#3

Thanks a lot! It worked!


#4