Help: Keeping Track Of The Produce


#1


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]


#2

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


#3

I still don't get it


#4

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


#5

Cheers and thanks for helping. I finally got it


#6

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