Question: Create a python code for the given problem. Please include an interface for the user to type the input value. Problem D: Oinkway Pig Latin

Create a python code for the given problem. Please include an interface for the user to type the input value.
Problem D: Oinkway
Pig Latin is a language constructed by transforming English words. The following rules are used to translate English into Pig Latin: If the word begins with a consonant, then all consonants at the beginning of the word, up to the first vowel are removed then added to the end of the word, followed by "ay". If the word begins with a vowel, then "way" is added to the end of the word. If the word ends in a punctuation mark, then the punctuation mark should remain at the end of the word after the transformation has been performed. You can assume that punctuation marks will always only take up the space of a single character.
Create a program that reads a line of text from the user, translates it into Pig Latin and then displays the result. In the spirit of the times, however, we will use "slay" instead of "way" and "eyy" instead of "ay".
Hint: Making a set of vowels and consonants of the alphabet will prove useful.
Sample Runs with INPUT and OUTPUT
\table[[Sample Run #1,Sample Run #2],[\table[[aight, imma head out, Charlie!],[aightslay,]],\table[[Look at the way that I code: very mindful, very cutesy.],[ookleyy]]],[immaslay,atslay],[eadheyy,etheyy],[outslay,,aywery],[arliecheyy!,attheyy],[,Islay],[,odecery:],[,eryveyy],[,indfulmeyy,],[,eryveyy],[,utesycey.]]
Create a python code for the given problem.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!