Skip to content

Instantly share code, notes, and snippets.

@sedaghatfar
Last active December 15, 2015 06:48
Show Gist options
  • Save sedaghatfar/5218506 to your computer and use it in GitHub Desktop.
Save sedaghatfar/5218506 to your computer and use it in GitHub Desktop.
[Python] Pig Latin translator
#Pig Latin translator
#codecademy
pyg = 'ay'
original = raw_input('Enter a word:')
if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
if first == ('a' or 'e' or 'i' or 'o' or 'u'):
new_word = word + pyg
print new_word
else:
j = len(word)
new_word = word[1:j] + first + pyg
print new_word
else:
print "empty"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment