Setting new_word again


Traceback (most recent call last):
File "python", line 2, in
NameError: name 'word' is not defined

I don't understand why it can't understand "name 'word'"

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


first = word[0] # here you use variable word
word = original.lower() # here you define what is a word

Interpreter does not know the future, it goes line by line :slight_smile: