Error: Keeping Track of the Produce


#1

This is my code:

price={"banana": 4,
"apple": 2,
"orange": 1.5,
"pear": 3}

stock={"banana": 6,
"apple": 0,
"orange": 32,
"pear": 15}

for key in price:
    print(key)
    print("price: %d"%price[key])
    print("stock: %d"%stock[key])

And the error is:

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


#2

print is not a function in Python 2, so those parentheses do not belong there even though technically they are allowed

The submission test probably looks for occurrences of "print " (with a space afterwards)


#3

Thank You, giving spaces worked.