12.Stocking Out


#1

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

Interpretor giving error message as"stock item deleted"

Help me!!!


#2

Please supply a link to the lesson. Thank you.


#3

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


#5

We'll need to see your complete code for this exercise.


#6

try on the last line:

stock[item] -= 1


#7

Thanks, I wrote the correct line but wrong indentation. This works


#11