Day at the Supermarket: Keeping Track of Produce


#1



Hi, I'm currently experiencing issues with this specific exercise, it seems that i have completed the task with the right formatting of the numbers but it continues to say that it does not look quite right. I assume this is because I completed the task slightly different from what the program is expecting and doesn't recognize completion

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


If someone could help me to understand if perhaps my code does not exactly execute what it seems to please let me know.


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


#2

It seems like there is some error with the first print statement. Re-check with the cost because it directly prints cost but there is nothing associated with the cost. But instead, put parenthesis to the cost and see if it helps.


#3

print Price and Stock in lowercase - it helps


#4

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