Track of the Produce


#1

price = {"banana": 4,"apple": 2,"orange": 15,"pear": 3}
stock = {"banana": 6,"apple": 0,"orange": 32,"pear": 15}
for item in prices:
print item
print "price: %s " % price[item]
print "stock: %s " % stock[item]

Above is my code, i am getting output but with following error

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

Could some one please help me on this.


#2

Think you need to use space before and after % on your print and dictionary is called prices not price


#3

Hi try to remove the space after the %s like that

print "price: %s"...
print "stock: %s"...

#4

@wizmarco Thanks, it's worked.