Doesn't Work. Please Help!


#1
pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
  word = original.lower()
  first = word[0]
  new_word = word + first + pyg
  final_word = new_word[1:len(new_word)]
print final_word

else:
    print 'empty'

This is my code but it doesn’t work. please help in order to solve this.


#2

why is print final_word not inside the if clause? You only want to print final_word if user input is valid.

also, final_word might need to be renamed to new_word for the exercise


#3

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