I don't know what I'm doing



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

I had a lot of trouble with the "Ending Up" part of the lesson. I came here to the Q&A forum, and I still have no idea what's going on with that. But somehow, for the love of God, I got it to go through. Now, literally nothing works. I don't even know how it's supposed to work, honestly. I have no idea what slicing means or how to read/operate it. The format of my code is surely wrong, but I don't know how to rectify it. I'm just lost.

pyg = 'ay'
new_word = word + first + pyg
new_word = new_word[1:len(new_word)]
original = raw_input('Enter a word:')

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


You have all the lines there, and they are all correct. However, it looks like the code was tossed into a blender and jumbled up. Review the instructions again, and see if you mightn't shuffle these lines into the correct order. The line,

print original

is not longer needed so you can remove that one.


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