Where can I improve my final PygLatin code? (it works)


#1



Attached is my final code for the PygLatin translator which works and I finished. Can anyone advise me where I could clean it up or make it easier to read? Any advice or criticism is much appreciated as I continue to learn. Thanks


# suffix for final translation
pyg = 'ay'

original = raw_input('Enter a word:')


if len(original) > 0 and original.isalpha(): 
    #'''ensures that input word is not blank and contains only alpha characters'''
    word = original.lower()
    first = word[0]
    new_word = word[1:len(word)] + first + pyg 
    #'''combines the word without first letter, with its first letter and suffix to the end'''
    print new_word
else:
    print 'empty'


#2

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