8:Keeping Track of the Produce


#1



Hi,I need help for my code.


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

This is my code:

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]

Please help me. Thanks.


#2

the print price and stock should be inside the for loop, in python this is done with indention


#3

Thanks!
It can work correctly.