What is wrong with this code -Pyg Latin Ending up


#1

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

the above syntax error is linked to this code. done all i means to correct this code, please i want to know whats wrong with the code

pyg = 'ay'

original = raw_input('Enter a word:')

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

#2

Hi,

new_word = [1:len(new_word)]

you need to specify the string variable's name to slice using the [] operator in the above line :wink:


#3

[1:len(new_word)]

assume len(new_word) is 5

What is [1:5]? You need to tell Python which list you want to take a slice of.