Finding total...I've been stuck for an hour


#1


I need to first multiply the value in prices by the value in stock to get the profit for each item. I have figured out how to do this for each individual item, but how do I add together all of those items to get my total?


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:
    print key
    print "price: %s" % prices[key]
    print "stock: %s" % stock[key]
    print prices[key]*stock[key]


#2

for each key in prices you need to print that key's price multiplied by (*) the key's stock.
After you've multiplied those, on a new line, increment total by the value you just calculated.
Finally, out of the loop, print the total.


#3