Keeping trace of product


#1

prices = { "banana" : 4 , 
"apple" : 2 ,
"orange" : 1.5 ,
"pear" : 3 }
stock = { "banana" : 6 ,
"apple" : 0 ,
"orange" : 32 ,
"pear" : 15 }

for number in prices :
    print number
    print "price: %s " % prices[number]
    print "stock: %s " % stock[number]

same problem in mine. please help. TIA


Some one please help me with my orange!
#2

you have an additional space after %s, remove the space, it causes the error


#3

@stetim94 : That's the correct solution Thanks :slight_smile:


#4

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