If else statement indention error?


#1

I’m not sure if this is posted in the right forum but whenever I try to use the following code

#set national variables
pyg = 'ay'

#get and test input
original = raw_input('Enter a word:')
if len(original) > 0 and original.isalpha():
else:
  print "Please enter a valid word"

# convert input to lowercase and seperate necessary components
word = original.lower()
first = word[0]

# Re-organize new word
new_word = word + first + pyg
new_word = new_word[1:len(new_word)]

it gives me an indentation error at the else statement. I’m not sure why this would be. Thank you for your time


#2

your if clause is empty:

if len(original) > 0 and original.isalpha():
   # can't be empty!!
else:
  print "Please enter a valid word"

see comment. What (part of your) code should be here (inside if clause)? What logic should happen when the input is valid?