Keeping track of produce... error?


#1

keeping track of produce

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

its correct. don't understand the error.

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

is it a glitch? I don't understand the erroe


#2

Per the example at left, price should be singular.


#3

i cant believe i missed that. Thanks for the catch! :slight_smile:


#4

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