11. Accepted but translator not working?


#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[1:len(new_word)] + first + pyg
print original

else:
print 'empty'

Any thoughts?


#2

Two things...

  1. new_word is undefined in len(new_word)
  2. print should be new_word, not original

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
    new_word = new_word[1:len(new_word)]
    print new_word
else:
    print 'empty'

#4

hi,
pyg = 'ay'
original = raw_input('Enter a word:')

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

i wanted to know how i can fix this, it works and all, but when i put a really long word or phrase just to test it, it cuts most of it off when its not supposed to. For ex. neurologist returns eurologisnay missing the t


#5

See the post above for comparison.