Error with printing orange more than a space problem


#1

prices = {
"banana": 4,
"apple": 2,
"orange": 1.5,
"pear": 3
}
stock = {
"banana": 6,
"apple": 0,
"orange": 32,
"pear": 15
}

for x in sorted(prices):
print x
print "prices: %s" % prices[x]
print "stock: %s" % stock[x]

I tried this code with sorted and without and gives the same error. I put space and removed them in all combinations and did not do the trick for me.
Any ideas?

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


#2

a product has a price, not prices (the validition is very strict)


#3

Thank you for letting me know but in the instructions it is written as prices!


#4

there is an example of how the output should look like, there its most certainly price:


#5

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