Skip to content

Instantly share code, notes, and snippets.

@thelatefuture
Last active September 4, 2015 03:20
Show Gist options
  • Save thelatefuture/f6d88cd6e1b22fea108c to your computer and use it in GitHub Desktop.
Save thelatefuture/f6d88cd6e1b22fea108c to your computer and use it in GitHub Desktop.
Pig Latin translator
#一个调换字母顺序的游戏
pyg = 'ay'
original = raw_input('Enter a word:')
if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
new_word = word + first + pyg
new_word = new_word[1:]
print new_word
else:
print 'empty'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment