Keeping Track of Produce : can't get output!


#1




Check what your code prints for orange. It doesn't look quite right!


prices={}
prices['banana']=4
prices['apple']=2
prices['orange']=1.5
prices['pear']=3
stock={}
stock['banana']=6
stock['apple']=0
stock['orange']=32
stock['pear']=15

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


#2

got the solution.. just I have to keep space between : and %s in both print statements :slight_smile:


#3

A post was split to a new topic: Still doesn't work


#4

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