Help with 9/13 "Something of Value"


#1

prices = {
"banana" : 4,
"apple" : 2,
"orange" : 1.5,
"pear" : 3,
}
stock = {
"banana" : 6,
"apple" : 0,
"orange" : 32,
"pear" : 15,
}

for key in prices:
print key
print "price: %s" % prices[key]
print "stock: %s" % stock[key]

for key in prices:
print prices[key] * stock[key]

I don´t know how to add the results of prices*stock pls help


#2
for item in prices:
    item_cost = prices[item] * stock[item]  # finds cost of all stock of an item (item_cost)
    total += item_cost # adds item_cost to running total
print total

#3

@bitslayer43180 and @saluszavalia that is a really overcomplicated way of solving it
all you have to do is

     total = 0
     for n in prices:
          total = total+ prices[n] * stock[n]
          print total