10/11 pig Latin


#1

pyg = 'ay'

original = raw_input('Enter a word:')

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

my code keeps throwing off this error:
File "python", line 10
new_word = [1:]
^
SyntaxError: invalid syntax

I can't seem to figure out the problem here. I have looked at several other posts for a solution but I can't find one. Thanks for the help.


#2

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=new_word[1 : len(new_word)]
print new_word

else:
print "empty"


#3

The second code does not work. it says that there is an invalid syntax on line 5. What do I do?


#4

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 = new_word[1:len(new_word)]
print new_word[1:]

print original

else:
print 'empty'