Efficient PygLatin Remix


#1



I'm not so much stuck, but has anybody found a more efficient way. The only other thing I can think of is to remove the variable 'pyg' and just add the string 'ay' to the print function.


pyg = raw_input('Enter a suffix like \'ay\'.')
original = raw_input('Enter a word:')
if len(original) > 0 and original.isalpha() and len(pyg)>0 and pyg.isalpha():
    word = original.lower()
    print word[1:len(word)]+word[0]+pyg 
else:
    print 'Error, please ensure you are typing using only letters.'


#2

I think that for this exercise you are allowed to set pyg just to "ay". That way you don't have to have the "and len(pyg)>0 and pyg.isalpha()". Also, "word[1:len(word)]" can be just be shortened to "word[1:]".