Keeping Track of the Produce - My code seems to produce the correct result, nevertheless Codeacademy says it's wrong!


#1

https://www.codecademy.com/en/courses/python-beginner-en-IZ9Ra/1/3?curriculum_id=4f89dab3d788890003000096

My code seems to behave correctly. Codeacademy keeps saying it's wrong.

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


#2

They want

apple
price: 2
stock: 0

You give

apple
Price: 2
Stock: 0

See the difference?


#3

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