Ending Up



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
    print 'empty'


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

... = new_word[ ... ]


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"!


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


Right. I thought I had that. Thanks!


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