0
print 'Welcome to the Pig Latin Translator!'

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

  else:
    print "empty"

This is what interpreter says:

File "python", line 8
    else:
       ^
SyntaxError: invalid syntax

What am I doing wrong?

tom
  • 21,844
  • 6
  • 43
  • 36
gonza
  • 3
  • 4

1 Answers1

4

Your indentation for your else has to follow your if.

This is for Python in general, indentation matters.

print 'Welcome to the Pig Latin Translator!'

# Start coding here!

original = raw_input("Enter a word:")

if len(original) > 0:
    print raw_input

else:
    print "empty"
Isaiah
  • 91
  • 6