Check Yourself


#1



https://www.codecademy.com/courses/python-beginner-2W5v7/0/4?curriculum_id=4f89dab3d788890003000096


The exercise is letting me move on, but if I enter a word, the code is returns with :
Welcome to the Pig Latin Translator!
Enter a word: asdf

empty
None


According to the instructions, the word I entered (asdf) should be printed to the console.


print 'Welcome to the Pig Latin Translator!'

# Start coding here!
raw_input("Enter a word:")
original = raw_input ()
if len(original) > 0:
    print original
else:
    print "empty"


#2

For me, I changed

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

to

original = raw_input("Enter a word:")

Reason: in your above example, you get input and don't store it in a variable. Then you get MORE input and store it in the original variable.


#3

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