Check what your code prints for orange


I tried to use:
for key in prices:
print key
print "price: %s" % prices[key]
print "stock: %s" % stock[key]
When I run this piece of code, the outcome is the same but still the error: 'Oops, try again. Check what your code prints for orange. It doesn't look quite right!' keeps popping up, but I don't understand why? I quess this is the case because codeacademy want's us to use the ''print "%s" % key'' code line.

Keeping Track of the Produce

Have you "multiply the number in prices by the number in stock" at the end of your def, printed it and add it to total?


for fruit in prices:
print fruit <--- this part prints fruit's name
print "price: %s" % prices[fruit] <--- this part prints price from prices
print "stock: %s" % stock[fruit] <--- this part prints stock from stock


Stupid error took me forever

There is a difference between:

I was printing Price and couldn't get the right answer. Changed it to price and it passed.


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