Hey could someone help me out



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

prices = {
   "banana": 4,
   "apple": 2,
   "orange": 1.5,
   "pear": 3}
stock = {
    "banana": 6,
    "apple": 0,
    "orange": 32,
    "pear": 15}
for food in prices:
    print "%s price: %s stock: %s" %(food, prices[food], stock[food])


the product, price and stock should be printed at separate lines with 3 print statements


sorry I don't really understand what you mean could you try and explain it in more depth


your currently have 1 print statement which causes the following output:

orange price: 1.5 stock: 32

all on 1 line, but in the example:

price: 2
stock: 0

the output is on 3 seperate lines, you should also have this

This is achieved by using 3 print statements


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