PygLatin - Check Yourself!


This is the code I have, but when I type in a word and press enter, the program just keeps spinning. I don't get an error or anything; it is just stuck. Have I done something wrong?

print 'Welcome to the Pig Latin Translator!'

original = raw_input("Enter a word:")
if len(original) > 0:
print original
print empty


I'm assuming that your if/else has all the proper indents. If so, I don't see why it wouldn't work, it works fine for me. Have you tried reloading the page? You may also want to try leaving the exercise and going back in.


Please format your code correctly next time!

This may be a loading error as @mkordik suggests, but it seems you are trying to print a variable called empty that you never declare. That would produce an error, however. Either way, attempt to fix that. Good luck.


Thank you. I will try that.


I defined

empty = ""

and that did not work either


And refreshing the page didn't work either?


Okay, it seems like it's a loading error then. Try working on a different wifi network if possible. If nothing works, this webpage should help you report the glitch to Codecademy officials.


empty isn't a variable. So it should be


Try deleting brackets and their content when you define the variable -original-, like this: original=raw_input
If you don't do this, the program asks again to give it the name/word: it gets confused because you have already given a name before.


empty is not a variable like original. It is a string and needs to be in quotes.


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