Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pig Latin is a silly thing we do to words, where we cut off some of the beginning of the word and put it at

image text in transcribed
image text in transcribed
Pig Latin is a silly thing we do to words, where we cut off some of the beginning of the word and put it at the end (sometimes). The rules for pig latin at least for this problem are: 1. If the word starts with a vowel, then add 'yay' to the end of the word. Vowels for this problem are 'a', 'e', '1', 'o', 'u', 'y. Y mostly makes a vowel sound so we'll call it a vowel since we're going phonetically. a. Of becomes ofyay b. Inside becomes insideyay C. A becomes ayay 2. If the word starts with a consonant, then take all of the first contiguous consonants and put them at the end of the word, followed by 'ay'. a. Happy becomes appyhay b. Strange becomes angestray C. Thorough becomes oroughthay Input a sentence and split it into words, convert those words to lower case to prevent having odd capital letters in the middle of words. I stripped off "."and","characters from the words to get rid of punctuation, and you are permitted to do the same. Output the new Pig Latin words with spaces between them. Call the file pig_latin.py Note: Slices for this problem are permitted. Sample Output linux1[150] % python3 pig_latin.py Give me a sentence to convert: Convert this sentence into pig latin. onvertcay isthay entencesay intoyay igpay atinlay linux1[151] % python3 pig_latin.py Give me a sentence to convert: thoroughly strange this process is oroughlythay angestray isthay ocesspray isyay linux1[152] % python3 pig_latin.py Give me a sentence to convert: Python is a powerful language that lets you do very useful things. ythonpay isyay ayay owerfulpay anguagelay atthay etslay youyay oday eryvay usefulyay ingsthay

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

8. Praise the trainees for their success in learning the task.

Answered: 1 week ago

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago