Keeping Track of the Produce :please help me this code


#1


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

for item in prices:
    print item
    print "prices : %s "% prices[item]
    print "stock : %s "% stock[item]

## this is my code am not getting what is the error, i keep on gettiing this message
" Oops, try again. Check what your code prints for orange. It doesn't look quite right!"


#2

This exercise is very strict about formatting.

Your one of the o/p should look like this..

orange
price: 1.5
stock: 32

#3

so what modifications i should do?


#4

You can see,that its price not prices (in the string part)?

also there is no space after the values.


#5

where you are saying there is no space?can you please tell


#6

After %s there is one space.


#7

thank you :slight_smile:


#8

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