6.4 PygLatin NameError: name 'original' is not defined "Why is this the case?"


Replace this line with your code.


print 'Welcome to the Pig Latin Translator!'

Start coding here!

raw_input("Enter a word")
original = raw_input()

if len(orignial) > 0:
print (original)
print "empty"

This is the code btw


Hey there @whiskeymyers

The issue with your code is that you try to set the original to a random raw_input() that doesn't exist . Simply change your code to the following:

print ("Welcome to the Pig Latin Translator")

original = raw_input("Enter a word: ")

if len(original) > 0:
     print "empty"

This will set the variable original to the result of the raw_input() . Hope this helps.


It's still giving me the same "NameError", telling me that 'original' is not defined.



This is weird... Can you post your code after it was updated or try refreshing webpage sometimes it helps.


You really should be doing this:

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = ""

if len(original) > 0:
    print "You typed a word"
    print "empty"

I hope this helps! :smile:


I think the main reason is you got a typo in



That's what it was. Thank you!