A day at the supermarket


#1


https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/1/4?curriculum_id=4f89dab3d788890003000096#

It shows an error :
Oops, try again. It looks like your code did not print the correct total.
Please help.

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]
    
total = 0

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


#2

here:

prices[x] = prices[x] * stock[x]

don't update the price of products. Store the result of this multiplication in a different variable so you can it to total


#3

Thanks for the help.


#4