I need help with this one


#1

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

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

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

Write your code below!

def compute_bill(food):
total = 0
for item in food:
if stock[item] > 0:
total = total + price[item]
stock[item] = stock[item]
return total


#2

Hello @parzivalhalliday,

What is the error that your code is throwing?


#3

sorry i found out i was just being stupid


#4

Haha, that is okay, @parzivalhalliday. These kinds of things will happen often, but you have to keep persisting and keep coding hard :laughing:!