Help: Keeping Track Of The Produce


8. Keeping Track Of The Produce

I have no idea how to do it. 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 "Prices: %s" % prices[key]
    print "Stock: %s" % stock[key]


you should also print the product name (key):

for key in prices:
    #print the key on the line below
    print "Prices: %s" % prices[key]
    print "Stock: %s" % stock[key]

also, it should be price (all lowercase, without s) and stock all lowercase on the lines below


I still don't get it


and what is it you don't understand? You should also print the key, which hold the product name:

print key

and the string you print should be an exact match:

print "Prices:
print "Stock:

Prices should be price (without s, and lowercase p) and stock should have a lowercase s


Cheers and thanks for helping. I finally got it


I also change all instances of "Prices" to "Price", refreshed the screen, and it worked. Thanks alot!