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



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
        print "no words"


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 ""


Awesome, thank you!!


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