Testing Testing, Is This Thing On? Weird error!


This is what I have in the code:

pyg = 'ay'

original = raw_input('Enter a word:')

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

AND this is the error message I am getting in the console:

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

Please let me know what I am doing wrong. Thanks!


new_word isn't defined at this point. Which is causing an error.


How do I define new_word?


Assign it to something that isn't itself. Example:

my_number = 5


What do I put instead of new_word?

new_word = [1:len(new_word)]

Running it like that ^^ without new_word in the variable doesn't work either.



new_word = [1:len(new_word)]
#HERE                HERE

You are still assigning it to itself.


Oh ok thank you so much!