A Day at the Supermarket


prices = {
"banana": 4,
"apple": 2,
"orange": 1.5,
"pear": 3

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

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

prices: 1.5
stock: 32
prices: 3
stock: 15
prices: 4
stock: 6
prices: 2
stock: 0

what's wrong with the orange code?
I think the output is correct.


This is a very, VERY usual problem in Codecademy. Your code is right, but you must print

"price: %s"

Instead of

"prices: %s"

Because of the system wants you to print just "price:" and "stock" all by lowercase, there are always this kind of problems. I really hope that this gets fixed...


Thank you for your answer.


No problemo, this is a very usual problem. And as I said this wouldn't be hard to fix.


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