New_word help


#1

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

Returns me the following error:

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

PLEASE HELP


Ending up
#2

Consider

a = a[1:]

A slice index expression needs an object to slice.


#3

new_word = word [1:len(new_word)] + first +pyg


#4

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