Check Yourself - Does your code print "empty"?


#1



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

I am able to complete the exercise by entering text but if I dont input anything and progress the console returns "none" and gives me the error "Oops, try again. Does your code print "empty" when len(original) is 0?"

I have looked at other topics here and played around with the indentation but I can't find what it causing it to fail to print.

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input("Enter a word:")

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

#2

here:

if len("original") > 0:

you get the length of string original, not of what the user entered (which is stored in original variable)


#3

Ah brilliant I can't believe I missed that. Thanks for the help that resolved my issue.


#4

#5

You're most welcome :slight_smile: