Setting new_word again


#1



https://www.codecademy.com/en/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096#

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
else:
    print 'empty'


#2

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: