Created
July 31, 2014 21:09
-
-
Save kevgathuku/0e7117541e69c3e499da to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
pyg = 'ay' | |
while True: | |
original = raw_input('Enter a word: \t') | |
if len(original) > 0 and original.isalpha(): | |
word = original.lower() | |
first = word[0] | |
vowels = 'aeiou' | |
if first in vowels: | |
new_word = original + pyg | |
print new_word | |
break | |
else: #The word is a consonant | |
new_word = original[1:] + first + pyg | |
print new_word | |
break | |
else: | |
print 'You entered invalid input. Please try again' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PyGlatin Codecademy Project Slightly modified to run again if invalid input is detected