Keeping Track of the Produce


#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 key
    print "Price: %s" % prices[key]
    print "Stock: %s" % stock[key]

i type like that and it says like this

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

What Wrong??


#2

The format described is in all lower case


#3

Oh just like that?? i dont know.....! Thanks loot bro


#4

Its still showing the same thing, though my output is correct (atleast that's what I think)

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


#5

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