What is wrong with my code? A Day At The Supermarket 9/13 SOLVED


#1

What is wrong with this code? I don't get it?

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

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

Thanks in advance!


#2

ithink you forgot = for calculating total like this !! total += (prices[key] * stock[key])


#3

YEah you're right! thanks!