Why do i keep getting an error which says did you create the new_word variable?


pyg = 'ay'

original = raw_input('Enter a word:')
word = original.lower()

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


A lot is mixed up here.

Your else loop shouldn't have anything but:

    print 'empty'

Re-write code, especially the if block.


thanks mate, it was a mistake on my part with the indentation


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