(Help) A Day in the A Super Market -Stocking Out


#1

Can someone help me with this. I really need help.

prices = {
    "banana": 4,
    "apple": 2,
    "orange": 1.5,
    "pear": 3
}
stock = {
    "banana" : 6,
    "apple" : 0,
    "orange" : 32,
    "pear" : 15
    }

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

#2

Indentation is correct. It's just the Codecademy Paste format.


#3

Is this a continuation of an earlier thread? We may end up merging the two, but keep the discussion in this one, from this point forward.

For this line, we had earlier defined the food parameter. Let's stick with that.

def compute_bill(food):
    total = 0
    for item in food:

These two lines are in reverse order.

        stock[item] -= 1
return total