Two separate answer that both work, but one will not let you proceed


#1



# this does not work but answers the question

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    word = original.lower()
    first = word[0]
    word = word[1:len(original)]
    new_word = word + first + pyg
    print new_word
else:
    print 'empty'
    
# This works and answers the question
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)]
    s = new_word
    print s
else:
    print 'empty'


#2

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