Python 2: What is wrong with my code? Pig Latin Lesson: Check Yourself

Hello,
I have been having trouble with this lesson. I’ve checked the previous related posts from the forum for more additional help, but I am still confused. I’m sure I’ve managed to write my code correctly but this red error keeps showing on the output editor’s screen as shown in the screenshot below. Why and how can my code be fixed?

Thanks in advance

Could you post a link to the exercise? It is very possible that the terminal isn’t interactive, which means you can’t use raw_input(). Just assign a random value to that variable.

1 Like

If I can’t use the raw_input( ), then maybe i can put
original = (“Enter a word”) ?

the link to the exercise is
https://www.codecademy.com/courses/learn-python/lessons/pyglatin/exercises/check-yourself

thank you for your help. Your suggestion actually worked.
I deleted the raw_input ( ) function and kept it as:

original = (“Enter a word”)
if len(original) > 0:

print original

else:

print “empty”

Thank you so much for your help. :grinning:

1 Like

Based on your screenshot, and me working the lesson, the console is actually able to accept input, though you can still hard-code an answer if you would like to.

If the console is unable to accept input, Python will respond with an end of file error, or an EOF.
In the case above, for some reason it didn’t process quick enough, and so Codecademy’s server terminated it. Reloading the page usually fixes it for me if it gets hung up like that.

1 Like

I had this problem before while working in the python 2 course, especially in the Battleship lessons, the raw_input() function will never work, saying that it took too long to terminate, and that happened in almost all lessons after that.

1 Like