Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in python please. Please show the output too **NOTE**: You may **NOT** use the string method 'split() for this problem, as it creates a 'list',
in python please.
Please show the output too
**NOTE**: You may **NOT** use the string method 'split() for this problem, as it creates a 'list', which we have ... covered in class. Trust me; you'll love 'split(' all the more once you try this problem without it.. Write a function that accepts a single string, composed of words separated by spaces. Each word consists of lowercase and uppercase letters only. We would like to convert the sentence to "Goat Latin" (a made-up Language sinilar to Pig Latin.) The rules of Goat Latin are as follows: - If a word begins with a vowel ('a', 'e', '1', 'o', or 'u'), append 'ma' to the end of the word. For example, the word 'apple' becomes 'applena'. - If a word begins with a consonant (1.e. not a vowel), remove the first letter and append it to the end, then add 'ma'. For example, the word 'goat' becomes oatgna. - Add one letter 'a' to the end of each word per its word index in the sentence, starting with the 1st word. For example, the first word gets 'a' added to the end, the second word gets 'aa' added to the end and so on: python def main(): original_sentence = "I speak Goat Latin" goat_latin_translation - translate_sentence_to_goat_latin(original_sentence) print(goat_latin_translation) Which results in: 'text Imaa peaksnasa oatGmaaaa atinlaaaaa Return the final sentence representing the conversion to Goat Latin. The function should be called ** translate_sentence_to_goat_latin()'**, inside the file **(goat_latin.pyl(goat_latin.py)**. You may assume the original sentence will contain **at least two words**Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started