Ending up!


#1

OMG, it is driving me mad. I have wrote out my code as follows:

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

but alas, to no prevail. The console window keep printing out this:

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


#2

Hello, @owey!
Whenever we slice a string, we should put the name of it and brackets with the beginning and ending of it.
Example:

new_word = new_word[1:len(new_word)]

Quote me if there's anything else I can help you with!

Best regards,
g4be


#3

I think I have done that.

Just figured it out!

yg = 'ay'

original = raw_input('Enter a word:')

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


#4

Now it's correct!

Best regards,
g4be