Word Up


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

Here is my code^^^^

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

According to my error the colon is considered invalid syntax. Is there something that I am doing wrong?


for some reason the arrow is under the beginning of new_word, it is under the colon according to my error box.


I also tried changing the variable len(new_word) with and integer and the error still appeared and said the colon was invalid syntax


We need an object to take a slice of. This one is a slice of thin air. Try,

new_word = new_word[1:len(new_word)]