Oops, try again. first should contain the first letter of word.

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


We don't want first to contain the first letter of "word", but the previously assigned word value.

first = word[0]


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