Error in Exercise: Keeping Track of the produce


I allways get the same error, but it seems everything is ok.

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

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]


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:

price: 2
stock: 0

now check your format in the console. is it same?


Yes, that's how I'm writing it.

The problem is with the values for "orange", but I don't understand why.


I already got it. Thanks. Instead of "price" all smallcapitals I had written "Price".

Thanks for your help!!!!


I had a problem with oranges too i dont know what i did beside from refreshing but here you go if somebody needs it:

i think somethimes their program goes nutsXD


Thanks for your contribuition to my doubt.


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