Last active
December 17, 2015 04:09
-
-
Save dmatt/5548557 to your computer and use it in GitHub Desktop.
Code Academy - Pyg Latin Translator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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