Help please!


10 ending up

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


This is my code I can't figure out what is wrong with it

pyg = 'ay'
word= original.lower()
first = word[0]
original = raw_input('Enter a word:')
new_word = word + first + pyg
new_word = [0:len(new_word)]
if len(original) > 0 and original.isalpha():
    print original
    print 'empty'


when taking a slice, you need to specify of what you want a slice:


and then store the slice in a variable. also, you want the second letter (at index 1 till end), not sure if your slice is right.

also, think about the order in what you do things. here:

word= original.lower()

original isn't defined yet, please take a moment to think about the order in which you do things


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