I don't understand this!


#1

This code should have worked, but it doesn't!
"shopping_list = ["banana", "orange", "apple"]
stock = {
"banana": 6,
"apple": 0,
"orange": 32,
"pear": 15
}
prices = {
"banana": 4,
"apple": 2,
"orange": 1.5,
"pear": 3
}

Write your code below!

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


#2

You may find it easier to get a response if you make sure that your code is intact in your post and include a question so that there is something to respond to. The more specific the question is, the better - consider what piece of information you are missing to figure it out.