This is a python problem, after importing the problem3 module, I will type pig l
ID: 3753665 • Letter: T
Question
This is a python problem, after importing the problem3 module, I will type pig latin translator() in the Python shell to test problem3.py.
Problem 3 [20 points | Pig Latin. Pig Latin is a form of coded English often used for amuse- ment. There are many variations on the method used to form pig Latin sentences. Here, we use the following simple algorithm to translate an English word into pig Latin: » If the English word begins with a consonant, place the initial cluster of consonant letters at the end of the word, followed by the letters "ay" to it. For example, "road" translates to "oadray", "scream" translates to "eamscray", and "fly" translates to "flyayExplanation / Answer
pyg = 'ay' original = input('Enter a English Sentence:') if len(original) > 0 and original.isalpha(): word = original.lower() first = word[0] if first == ('a' or 'e' or 'i' or 'o' or 'u'): new_word = word + pyg print(new_word) else: new_word = word[1:] + first + pyg print(new_word) else: print (empty)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.