Keeping track of the produce


#1



https://www.codecademy.com/en/courses/python-beginner-en-IZ9Ra/1/3?curriculum_id=4f89dab3d788890003000096


I am getting an error message that says that what I'm printing for orange isn't quite right
Can anyone help?


Replace this line with your code. 
prices = {"banana": 4, "apple": 2, "orange": 1.5, "pear": 3}
stock = {"banana": 6, "apple": 0, "orange": 32, "pear": 15}
for x in prices:
    print x
    print "Prices: %s" % prices[x]
    print "Stock: %s" % stock[x]


#2

Prices: %s

price not Prices

also s of Stock should be lowercased! ("Stock: %s")


#3

Ohhhhhhh thanks! Now it works


#4

I made the printing part like this, but was not accepted. Why?

...
for key in prices:
print "%s \n price: %s \n stock: %s" % (key, prices[key], stock[key])


#5

Yeah,You have to use certain format there like this..
@josesan77

Fruit Name
price: Fruit Price
stock: Fruit Stock

If you try to format any other way,It will not accept and throw an error.

Reason:They need exactly 3 print statements.

You should have exactly three print statements! (Make sure there are no occurrences of 'print' in any comment or string!)


#6

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