Orange missing


#1



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

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.


#2

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


#3

I still can't understand


#4

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


#5

@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.


#6

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


#7

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....
THANK YOU CODECADEMY!!!! xD LOL


#8