Ending Up... Please Help


#1


Oops, try again. It looks like new_word contains "or" instead of "ordway"!

I need help


pyg = 'ay'

original = raw_input('word:')

if len(original) > 0 and original.isalpha():
    print original
else:
    print 'empty'
word = original.lower()
first_letter = word[0]

new_word = word + first + pyg
new_word = word[1:3]


#2

solution:

pyg = 'ay'

original = raw_input('Enter a word:')

word = original.lower()
first = word[0]
new_word = word[1:len(word)] + first + pyg

if len(original) > 0 and original.isalpha():
    print new_word
else:
    print 'Empty'

i was stuck on a syntax error, i just changed order of new_word and word in the definition of new_word and there it is!


#3

Thanks a lot!

I've got it now!


#4

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