Something of Value


#1



Oops, try again. It looks like your code did not print the correct total.

it doesnt print the total

Replace this line with your code. 
prices = {
    "banana" : 4,
    "apple"  : 2,
    "orange" : 1.5,
    "pear"   : 3,
}
stock = {
    "banana" : 6,
    "apple"  : 0,
    "orange" : 32,
    "pear"   : 15,
}
total=0
for key in prices:
    total = prices[key] * stock[key]
print total    
""" print key
    print "price: %s" % prices[key]
    print "stock: %s" % stock[key]"""


#2

here:

total = prices[key] * stock[key]

this will set total to prices[key] * stock[key], but anything already stored in stock gets overwritten while you should add what it already in total + prices[key] * stock[key]


#3

i understand now
thank you,


#4