Last active
February 15, 2017 04:09
-
-
Save jarhill0/e2b95aeb946dafc1a7e7bc1d55ed8777 to your computer and use it in GitHub Desktop.
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
| def pig(word): | |
| lower_word = original_word.lower() | |
| if lower_word[1] == "a" or lower_word[1] == "e" or lower_word[1] == "i" or lower_word[1] == "o" or lower_word[1] == "u": | |
| stem = lower_word[1:] | |
| first = lower_word[0] | |
| new_word = (stem + first+ "ay") | |
| else: | |
| stem2 = lower_word[2:] | |
| first2 = lower_word[0] + lower_word[1] | |
| new_word = (stem2 + first2 + "ay") | |
| return new_word | |
| original_word = input("type a word:") | |
| if not original_word.isalpha(): | |
| print ("not a word") | |
| exit() | |
| print(pig(original_word)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment