Mistake?


#1

Okay so I'm stuck on this one specific lesson, and by the looks of it, it seems as if everyone else is also stuck.
The directions directly and clearly state to:
Set new_word equal to the slice from the 1st index all the way to the end of new_word. Use [1:len(new_word)] to do this.

This is exactly what I'm doing, in fact when I skip over this part and I just go on to the next part, the code that they give is exactly what I gave! It keeps giving me a syntax error though.

MY CODE:
pyg = 'ay'

original = raw_input('Enter a word:')

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

THE CODE THEY GIVE TO ME RIGHT AFTER THIS LESSON:

pyg = 'ay'

original = raw_input('Enter a word:')

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

THE ERROR I RECEIVE:

File "python", line 10
new_word = [1:len(new_world)]
^
SyntaxError: invalid syntax


#2

need to make sure you variables are the same

you have new_world

suppose to be _word


#3

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