Check Yourself, I've done it too many times


#1

please help, here is my code:

print 'Welcome to the Pig Latin Translator!'

original = raw_input ("Enter a word:")

if len(original) > 0:

print original

else:

print "empty"

it says
"File "python", line 9
else:
^
SyntaxError: invalid syntax"

Please help me out!
Thanks


#2

This is most likely an indentation error.


#3

Hi you shouldn't indent the else statement


#4

U should remove some tabulates before else
something like this

if len(original) > 0 and original.isalpha():
    print original
else:
    print 'empty'

#5

A post was split to a new topic: Confused where the original.isalpha(): came from