Th orange error!


The orange error!
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]

I am getting an error that value for orange is not correct though I sis showing correct values
Price: 1.5
Stock: 32
Price: 3
Stock: 15
Price: 4
Stock: 6
Price: 2
Stock: 0

Replace this line with your code.


Hi, @thekulwindersingh ,

For this exercise and many others, your output must adhere closely to the spelling and case specified in the instructions. Compare your output to the given specifications. The example provided is ...

price: 2
stock: 0


Thnx @appylpye :slight_smile: I missed a simple thing.


I still don't know what's wrong with the code


its nothing but a simple spelling mistake if u look at the instructions it gives an example of the output in the format :
price: 2
stock: 0

So just change the spelling in the code that you wrote like:
print key
print "price: %s" % prices[key]
print "stock: %s" % stock[key]

Notice, i wrote price in the string and not prices.. this causes the error.
If, u do this then there will be no Orange error..