Something up with my for statement?


shopping_list = ["banana", "orange", "apple"]

stock = {
"banana": 6,
"apple": 0,
"orange": 32,
"pear": 15

prices = {
"banana": 4,
"apple": 2,
"orange": 1.5,
"pear": 3

def compute_bill(food):#adds total prices of all items to total
total = 0#sets value of total to zero
for pieces in food:#adds value of each item in prices to total
total += prices[pieces]
return total

My for loops doesn't iterate though my entire prices list.

Replace this line with your code.


Your posted code is not formatted, so we cannot see its indentation. However, the problem you have reported suggests that you need to check whether the indentation that you do have is correct.


That fixed it! Thanks so much:)