My code doesnt work


I got a problem with my code can someone please help me

Keeping Track of the Produce

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

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


Hi @gigajumper38418

A link to the proper lesson would help us assist you, so we can read the instructions.


All you need to do is remove this line,

And this dictionary,


this line:

print "%s" % food[i]

you could also just print i? since the keys of the prices dictionary are what you need

then this two lines:

print "Prices: %s" % prices[i]
print "Stock: %s" % stock[i]

it should be price and stock (all lowercase letters, and no s at the end

the printout should be an exact match


thank you I just had to erase the s at the end of the word price
now my code does work thank you :kissing_heart:


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