I'm getting an invalid syntax error



I'm getting an invalid syntax error with a carrot symbol pointing to the : sign.

I expect the code to work because I added what it told me to add.

Replace this line with your code. 
pyg = 'ay'
new_word = word + first + pyg

original = raw_input('Enter a word:')

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


That line should be just under,

first = word[0]

We need an object to slice...

new_word = new_word[1:len(new_word)]


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