10. ending up


#1

pyg = 'ay'

original = raw_input('Enter a word:')

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

else:
print 'empty'

What am I doing wrong?


Help on pyglatin 10 "ending up"
#2

you are missing two things here. First, new_word not only has to equal word +first +pyg but also has to equal the slice. So add another new_word equal statement. Also, in printing [1:len(new_word)] you need to print [1:len(new_word)] with something else.


#6

Hi bibleman13, I have the same problem but what does it mean it has to "equal the slice"?

My code is below and the error message is just "set new_word equal to the slice"

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:] + first + pyg
print new_word[1:]

else:
print 'empty'


#7

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