Making a purchse


#1



my code at the moment:


hopping_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):
total = 0
for i in food:
total = total + prices[1]
return total


Replace this line with your code. 
what do I do???


#2

HI this line

total = total + prices[1]

this part

prices[1]

you put 1 instead of i inside the []


#3

ahh nice thanks it worked!:grin:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.