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


#1



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

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

It should let me continue with the next exercise. There is no error on my program but, for some reason, it changes the order of the printing.


prices = {
    'banana': 4,
    'apple': 2,
    'orange': 2,
    'pear': 3
}

stock = {
    'banana' : 6,
    'apple': 0,
    'orange': 32,
    'pear': 15
}

for key in prices:
    print key
    print "prices: %s" % prices[key]
    print "stock: %s" % stock[key]


#2

Look here:

This should be your output (as Codecademy asks):

apple
price: 2
stock: 0

Codecademy is very strict on spelling.


#3

Yes, it should. But I've got exactly the same code, and gives me error.


#4

@hayrd, look at how price is spelled here in the instructions:

Compared to yours:

If this doesn't work, show us your new code.


#5

The solution by @intermediategamer worked. I had similar issues. A change in spelling fixed it.


#7

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