4. Check Yourself! Code doesn't want to work


#1



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


File "python", line 6
if len(original) > 0 and original.isalpha():
^
IndentationError: unexpected indent


Well, I'm wanting to solve it, obviously, but I've been looking at the forums, and it still doesn't work.


Replace this line with your code. 
print 'Welcome to the Pig Latin Translator!'

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

    if len(original) > 0 and original.isalpha():
        print original
    else:
        print "no words"


#2

You just need to move back your if and else statements to align them with your original statements and move your print statements where your if and else were. Obviously, in python, it is very important to keep your indents properly formatted or else even if the code is correct it won't work. So, for example:

if len(original) > 0:
    print ""

#3

Awesome, thank you!!


#4

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