8/13 Error: You should have exactly three print statements!


#1

Hello,

Thanks for this great forum !
I have a mistake on question 8: Keeping track of the produce:
https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/1/3?curriculum_id=4f89dab3d788890003000096

I'm receiving this error message:
"Oops, try again. You should have exactly three print statements! (Make sure there are no occurrences of 'print' in any comment or string!) "

Although I have the impression my code behave correctly.
Here is my code:


#Here are the prices of my fruits
prices = {
    "banana":4,
    "apple":2,
    "orange":1.5,
    "pear":3
    }

#Here is my stock
stock = {
    "banana":6,
    "apple":0,
    "orange":32,
    "pear":15
    }

#Let's print out all of my inventory information
for key in prices:
    print key
    print "price: %s" % prices[key]
    print "stock: %s" % stock[key]

This is the answer it produces:
orange
price: 1.5
stock: 32
pear
price: 3
stock: 15
banana
price: 4
stock: 6
apple
price: 2
stock: 0

Thanks a lot,

Thaïs


#2

Hi,

I've found the solution on another topic: you just have to erase "print" in the 3rd comment.

Good luck everyone,

Thaïs


#3

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