Im so lost


#1



a day at the supermarket - keeping track of the produce


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


it does the right thing yet error message appears


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

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

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


#2

Hi @corerunner16726,

Consider this line ...

print "prices: %s" % prices[items]

... with respect to the instructions. This is the specified format for the output ...

apple
price: 2
stock: 0

#3

print "prices: %s" % prices[items]

price not prices!

hint**
"prices: %s"


#4

Consider changing

print "prices: %s"  % prices[items]

to

print "price: %s" % prices[items]

#5

Can someone help me what wrong in this getting below error.

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

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]


#6

If you have anything commented out inside the code then delete that and submit again!


#7

Thanks for the reply.

Nothing commented. Reset the code and tried again still the same.


#8

can you post your code? (please do format)


#9

Thanks got it . Refreshed screen and it worked


#10

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