Last active
December 15, 2015 06:48
-
-
Save sedaghatfar/5218506 to your computer and use it in GitHub Desktop.
[Python] Pig Latin translator
This file contains 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
#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