PygLatin lesson expansion help


#1

I was expanding on the lesson provided to make the program more functional. In pyglatin (pig latin) the ch, sh, th, and wh sounds are all put entirely on the end of the word, which means that only moving the first letter as in the lesson only works with words that don't begin with one of those combinations. I was expanding my program to make both letters move to the end when I encountered a problem. for some reason when I try to select both the first and second letter to move to the end they don't move. I have added print functions in a couple of places to find what code is and is not running and it appears that only my first = word[0:1] function is not running, while the if statement it is contained within is running. Please tell me what I am doing wrong to get this to work. I have included my code.

http://pastebin.com/2zWRg04u


#2

See line 49 : if ch or sh or th or wh == True:
Maybe its because you have to put "" for ch, sh ... Like that if "ch" or "sh" ...
If it doesn't work try that code :

pyg = 'ay'

original = raw_input('Enter a word:')

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