Orange Error on A Day at the Supermarket


I am on the exercise, A Day at the Supermarket, and I'm stuck on this error

""Oops, try again. Check what your code prints for orange. It doesn't look quite right!""

This is my code

prices = {"banana": 4, "apple": 2, "orange": 1.5, "pear": 3}
stock = {"banana": 6, "apple": 0, "orange": 32, "pear": 15}
for item in prices:
    print item
    print "Price: %s" % prices[item]
    print "Stock: %s" % stock[item]

Can anyone show me what's wrong with my code?

Replace this line with your code.


Take a look:

This should be your output (as Codecademy asks):

price: 2
stock: 0

There's a typo, something isn't spelled right.


My code is structured as requested.

Price: 1.5
Stock: 32
Price: 3
Stock: 15
Price: 4
Stock: 6
Price: 2
Stock: 0


Yes, but the first letter is capitalized in Price and Stock. The instructions are strict on leaving them lowercased.


Ohh..Thanks. I'd now mark this post as resolved.


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]

Still i'm seeing above error "Oops, try again. Check what your code prints for orange. It doesn't look quite right!"
Can you please help me out?


Did you read this?:

If anyone else needs more help, or if this doesn't resolve your problem, please create a new topic like it's stated in the Guidelines. Thank you :slight_smile:


Okay Thank You!!

Thanks for your help. Working fine now for me.


Having the same problem and it's not to do with the capital P and S in the text part of the print statement - I have used small p and s there and it is still giving the same error message.


Please copy and paste your code here, to help us detect the cause of the error


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