9. Movie it on Back


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

need it to exicute, seence word is defined.

pyg = 'ay'

original = raw_input("Enter a word:")
new_word = word + first + pyg

if len(original) > 0 and original.isalpha():
        print  original
        word = original.lower()
        first = word[0]

       print 'empty'


from the instructions:

On a new line after where you created the first variable, Create a new variable called new_word

did you create new_word where the exercise told you to?

currently, you are referring to word before it is defined.

here you try to use word:

new_word = word + first + pyg

and then later in your script you define word:

word = original.lower()

you can't use variable before defining them


duh ! yeah your rigth, thank you !


you're welcome