A Day at the Supermarket


#1



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

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


I don`t see any difference with reference output...


prices={
    "banana": 4,
    "apple": 2,
    "orange": 1.5,
    "pear": 3
                }
stock={
    "banana": 6,
    "apple": 0,
    "orange": 32,
    "pear": 15
                }

for key in prices:
    print "%s\nprice: %s\nstock: %s" % (key,prices[key],stock[key])


#2

Hi, @jcheng44 ,

Yes, the output appears the same as what is specified in the instructions. Nevertheless, as the message states, you will need to supply an individual print statement for each of the items that you currently have collected into this tuple ...

(key,prices[key],stock[key])

, ... instead of using \n characters to separate the lines of output.


#3

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