8. Keeping Track Of Produce help


#1

Hello all! I've been working on this for a pretty long time and I am kind of stuck. Could you please explain what I've done wrong?

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


prices = {
    "banana": 4,
    "apple": 2,
    "orange": 1.5,
    "pear": 3
    
    }
    
stock = {
    "banana": 6,
    "apple": 0,
    "orange": 32,
    "pear": 15
    
    }
    
for key in prices:
    print "%s" % prices
    print "%s" % prices[key]
    print "%s" % stock[key]


#2

Study the instructions to find out what the output should be. Compare to your own.


#3

Thanks ionatan! That helped a lot. :slight_smile:


#4

print "price: %s" % prices[key]
print "stock: %s" % stock[key]

there is space blank before %s


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.