Question: Write a script that encodes English-language phrases into a form of coded language called pig Latin. There are many different ways to form pig

Write a script that encodes English-language phrases into a form of coded language called pig Latin. There sists of words separated by blanks, there are no punctuation marks and all words have two or more letters. 

Write a script that encodes English-language phrases into a form of coded language called pig Latin. There are many different ways to form pig Latin phrases. For simplicity, use the following algorithm: To form a pig Latin phrase from an English-language phrase, tokenize the phrase into words with string method split. To translate each English word into a pig Latin word, place the first letter of the English word at the end of the word and add the letters ay." Thus, the word "jump" becomes "umpjay," the word "the" becomes "hetay," and the word "computer" becomes "omputercay." If the word starts with a vowel, just add "ay." Blanks between words remain as blanks. Assume the following: The English phrase con- sists of words separated by blanks, there are no punctuation marks and all words have two or more letters. Enable the user to enter a sentence, then display the sentence in pig Latin.

Step by Step Solution

3.41 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Sure heres a simple Python script that encodes Englishlanguage phrases into ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!