i am having some trouble trying to follow the code in on-line learning but no response so i figured i'd google and ask here. what i am trying to accomplish is to print each counter and total for the loop to see and follow the logic: please let me know where i can type print total to see the loop in action.
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 x in food:
total+=prices[x]
return total