Keeping track procedure


#1

here is my code
rices = { "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: %d " % stock[key]

but the compiler shows the values of orange is not right
Oops, try again. Check what your code prints for orange. It doesn't look quite right!


#2

remove the space between %d and "

print "stock: %d " % stock[key]


#3

thanks for the info ./


#4

Hello
I am doing the same thing which is written here, but even then it is showing the same error i.e., Oops, try again. Check what your code prints for orange. It doesn't look quite right!

what should i do now??


#5

@visheshtanwar ,

Please post your code so that we can look for the problem.


#6

ya sue. this in my code

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 "Stock: %d" % stock[key]
print "Price: %s" % prices[key]


#7

Hi @visheshtanwar ,

Compare the format of your output to that specified in the exercise instructions. Do not capitalize the output unless the specified format indicates that you should do so.


#8

Thanks a lot. It fix my issue.


#9