Please figure out the problem?


#1

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

#2

this line:

print "prices:%s" % price[key]

it should price instead of prices, and after the colon there should be a space

the output needs to be an exact match


#3

# you have to change this please Like 
for key in prices:
print "prices:%s" % price[key]
print "stock: %s" % stock[key]


#Like this please
for key in prices:
       print "prices: %s" % prices[key]
       print "stock:  %s" % stock[key]

Correct please ?????????


#4

guchuuu simply forget markup, which means indent didn't show on the forum

as in your code., you have prices instead of price, and two spaces after stock: instead of 1


#5

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