Error with printing orange more than a space problem


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?


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


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


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


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