Skip to content

Instantly share code, notes, and snippets.

@dmatt
Last active December 17, 2015 04:09
Show Gist options
  • Save dmatt/5548557 to your computer and use it in GitHub Desktop.
Save dmatt/5548557 to your computer and use it in GitHub Desktop.
Code Academy - Pyg Latin Translator
pyg = 'ay'
print "Welcome to the Pyg Latin Translator"
original = raw_input('Enter a word to be translated:')
if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
if first in ["a","e","i","o","u"]:
new_word = word+pyg
print new_word
else:
new_word = word[1:]+word[0:1]+pyg
print new_word
else:
print 'empty, restart and try again'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment