Created
February 6, 2017 23:20
-
-
Save shamikalashawn/e0849465848e79e4978fce7c17a8eb73 to your computer and use it in GitHub Desktop.
Your word is turned into a "Pyg Latin" version of the word with the first letter going to the end and "ay" being added.
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
pyg = 'ay' | |
while True: | |
original = input('Enter a word to pygafy (Press Enter to quit): ') | |
if original == '': | |
print ("It's your perogative to quit. No judgement here.") | |
break | |
elif len(original) > 0 and original.isalpha(): #test if string entered is empty and all leters | |
word = original.lower() #stores lowercase version of input | |
first = word[0] #first letter in the string | |
new_word = word + first + pyg | |
new_word = new_word[1:len(new_word)] #slice of string that removes the first letter | |
print (original + " in pyg Latin is " + new_word + ".") | |
else: | |
print ("That's not a word! Try again.") #Need to figure out how to loop back to the top after an entry |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment