Question: *** In Python 23.2 Pig Latin Translator (Branching and Looping) Pig Latin is a language game, unrelated to Latin, in which English words are altered,

*** In Python

23.2 Pig Latin Translator (Branching and Looping)

Pig Latin is a language game, unrelated to Latin, "in which English words are altered, usually by adding a fabricated suffix or by moving the onset or initial consonant or consonant cluster of a word to the end of the word and adding a vocalic syllable to create such a suffix." For example, the translation of "Pig Latin" is "igpay atinlay".

For this assignment you will create a Pig Latin translator. There are several dialects, but we will use the following simplified rules:

  • For words that begin with a consonant, move the consonant to the end of the word and add "ay". e.g. pig > igpay
  • For words that begin with vowels (including 'y'), the vowel is left alone, and 'way' is added to the end of the word. e.g. eat > eatway

Write a program that gets a word from the user, translates to pig latin as described above, and prints the result.

You may assume that all input is lowercase letters, a-z.

You will need to use a combination of branching, looping, and indexing to accomplish this. Python's membership operator in will prove a useful way to construct necessary tests.

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!