Please help me


#1

please help me it said me '
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" : 2,
"pear" : 15
}

for key in prices:
print key
print "prices: %s " % prices[key]
print "stock: %s " % stock[key]`


8/13. Not working for me
#2

Hi @wizmarco ,

Because the code that you posted is not formatted, it is difficult for other users to read and debug it. After code has been pasted into the editing window for posting, you can format it by selecting it, and then by clicking the </> button above the editing area. Alternatively, you can place three backquotes on the line before the code and three backquotes on the line after the code. This will enable us to see important details, such as the indentation and underscores.

You have ...

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

The output should be in the format ...

price: 2

... not ...

prices: 2

You can use this to produce the required format...

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

#3

thanks a lots it works.. :grinning:


#4

Try reloading the page. The syntax seems correct to me. I have read the challenge and actually ran it and it worked for me!


#5

I have a same problem keeps reminding me of "missing orange price", after I deleted "S" after “price”, it worked out. Weird...