ymay ogday ashay easflay!(pronounced ''eye-may og-day as-shay ees-flay'' --- Pig-Latin is most entertaining when spoken quickly --- try it)
When a word begins with a vowel, then no leading consonants are moved, and instead, ''shay'' is attached to the end of the word. For example, I bought it on Ebay, yesterday. becomes
ishay oughtbay itshay onshay ebayshay, esterdayyay.Young people used rapidly spoken Pig-Latin as a code language that adults could not understand.
> python Piglatin.py Please type an English sentence: This is a test, I guess, of the program!! The PigLatin translation is: isthay isshay ashay esttay, ishay uessgay, ofshay ethay ogrampray!! Press Enter to quitThe program's input is an English sentence, typed one a single line of text. Standard punctuation, is allowed, but contractions ("don't") and possessives ("it's") are not. (Remember that every English sentence ends with a punctuation symbol.) The program's output is the sentence, reformatted as Pig Latin. Notice that all the letters in the output sentence are in lower case and that all the spacing and punctuation are preserved.
Remember that the vowels in English are a,e,i,o,u. The letter y is sometimes a vowel, too. We will use this rule: If y is the first letter of a word (e.g., "yes") it is a consonant, otherwise it is a vowel (e.g., "cry").
Here are some string operations that will be useful:
name = "Fred FlintStone" name = name.lower() # makes name = "fred flintstone"
word = "abCd" if word.isalpha() : # this will compute to True ....
Reminder: This is a single-person assignment. You are welcome to discuss the assignment with your instructors, tutors, and other students, but the algorithm you design and the program you write and submit must be your own work, just as if you are submitting an essay for an English Composition course.