12. Stocking Out


#1


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

My code

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

Error:

File "python", line 22
total = total + prices[i]
^
IndentationError: expected an indented block

I expect it will work. In earlier exercise this piece of code worked

Replace this line with your code.


#2

but then you add an if statement so additional indention is required


#4

Thank you very much!


#5