Syntax Error on [1: new_word]


#1



Replace this line with your code.


#2

Heres my code from the first post....

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_word)]
else:
    print 'empty'

#3

this line:

new_word=[1:len(new_word)]

if you want to updated your new_word variable, you should specify you want the substring of new_word stored in a updated version of your new_word variable:

new_word=new_word[1:len(new_word)]

#4

Thanks, I had the same issue and you solved it :slight_smile:


#5

me too ..........................................i hate this character thing