10/11 error


#1

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

My Code : pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

You shoul define the list "word" as empty before your code;

word = []

That'd be enough. :smile:


#3

As you can easily see from your if/else statement you never actually define word because if there is data in your original then it will always pass thus skipping the assignment step.