Testing Testing, Is This Thing On? Weird error!


#1

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
else:
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!


#2

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


#3

How do I define new_word?


#4

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

my_number = 5

#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.


#6

Look:

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

You are still assigning it to itself.


#7

Oh ok thank you so much!


#9