Ending Up


#1



https://www.codecademy.com/en/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096#


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


If I'm just dull then please enlighten me, but this seems like a badly explained step. I have no idea what I'm doing wrong. I'd really appreciate some help here. I've been looking for an answer for hours.


pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

We need an object to be able to slice, just as we would to reference an element.

... = new_word[ ... ]

#3

Ok. Thank you! That helped

Now I've got:

new_word = new_word[1:len(new_word)]

Now I'm just getting this error:

Oops, try again. It looks like new_word contains "" instead of "orsehay"!


#4

isalpha is a method, so it must be invoked with ().


#5

Right. I thought I had that. Thanks!


#7

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