Skip to content

Instantly share code, notes, and snippets.

@shamikalashawn
Created February 6, 2017 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shamikalashawn/e0849465848e79e4978fce7c17a8eb73 to your computer and use it in GitHub Desktop.
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.
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