Check what your code prints for orange


#1

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
#2

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?


#3

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


#4

Stupid error took me forever

There is a difference between:
price
Price

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


#5

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