Keeping track of the produce


Oops, try again. Check what your code prints for orange. It doesn't look quite right!

price: 2
stock: 0

prices={ "banana": 4,
"apple": 2,
"pear": 3  
for key in prices:
    print  "apple"
    print "prices: %s" % prices["apple"]
    print "stock: %s" % stock["apple"]


you should print all products name, price and stock quantity? Not only for apple.

and a product has a price, not prices


edit - nvm, I got it. didn't realize it was also sensitive about capitalization.

Don't know what I'm missing. The output is correct, but still says there is something wrong with the output for orange.

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]


Use identation after the loop


that is because no markup/format was used, so indent won't show on the forum