10/11 Ending up


6.PygLatin 10/11 Pyglatin Ending up

File "python", line 9
new_word = [1:len(new_word)]

SyntaxError: invalid syntax

I expect it to just work correctly

Replace this line with your code. 
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 new_word
    print 'empty'
At the new_word =[1:len(new_word)]
it says that the : between 1 and len is invalid syntax
what's wrong with my Code?!?


Just purely looking at what is wrong with that line, you want so select the second until the last letter of new_word? You can do this, but then you need to specify you want this from new_word:

new_word = new_word[1:len(new_word)]

otherwise you use something covered later, but lets not run ahead.


That's the answer!
I had the same problem as maartenww but this solved it.
Thank you :smiley: