Ending up PygLatin


#1


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

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 len(new_word)]
print new_word
else:
print 'empty'


#2

Problem is in this line (as the error message states):

new_word = [1 len(new_word)]

You have to specify what you want to slice and you should separate indices by a colon.


#3

Thanks I was really confused by it but I get it now!


#4

You're very welcome :slight_smile:


#5

2 posts were split to a new topic: Ending up


#8