10. Ending Up................ Python PygLatin


#1


is the code supposed to be broken up in the test screen? also does this only work with words that start with o becuase of what i have chosen for first? The code is only successful with o words.


pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

Did you mean, word[0]?

Not expected or asked for. Please remove these lines.

Should probably pass, but the instructions ask us to assign the slice back onto new_word, and then print that.


#3

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