Stocking out - what's wrong with this code?


#1

whats wrong with this 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:", prices[item]
print "Stock:", stock[item]


Check what your code prints for orange. It doesnt look quite right.?
#2

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


#3

Follow the example given in the lesson text at left. Notice the string formatting? Letter case? Spelling and white space.


#4

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