Orange missing


Prices = {"banana":4, "apple":2, "orange":1.5, "pear":3} stock = {"banana":6, "apple":0, "orange":32, "pear":15}
for names in prices:
print names
print "prices : %s" % prices[names]
print "stock : %s" % stock[names]
(Error- Oops, try again. Check what your code prints for orange. It doesn't look quite right!)

Replace this line with your code.


I have the same issue as you. Although I think that the solution works properly (1) code academy gives another one see below (2)

(1) My solution: In 19 steps
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 'prices: %s' %prices[key]
print 'stock: %s' %stock[key]

(2) The solution that codecademy gives is: In 27 steps

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]

Go ahead and see 9.Something of Value


I still can't understand


Don't understand either, can't see the difference...


@bitrockstar00693 and @ceefeels ,

In a previous post in this thread, @jose.lopezp reported having changed this ...

print 'prices: %s' % prices[key]

... to this ...

print 'price: %s' % prices[key]

... and reported that it worked. It is important to make sure that your code conforms precisely to the details given in the instructions.


Thank you so much for that. I was going crazy trying to figure what was wrong with my code! :grinning:


Thank you so much!!! I've been trying to figure out what I did wrong with it for almost half an hour...
and the only reason is that i add 's' after the price....