A Day at the Supermarket


#1

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

Code:
prices={
"banana": 4,
"apple": 2,
"orange": 1.5,
"pear": 3

}

stock={
"banana": 6,
"apple": 0,
"orange": 32,
"pear": 15
}
for item in prices:
print item
print "prices: %s" % prices[item]
print "stock: %s " % stock[item]

what problem?


#2

This exercise is very strict about formatting.

read the instruction again....

Like the example above, for each key, print out the key along with its price and stock information. Print the answer in the following format:

apple
price: 2
stock: 0

Can you find any difference ?


#3

there is a 's' in price... thanks!


#4

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