Question: Using python, loops allowed. please find a way to use loops without the break, continue or pass functions. Track - Acktray in pig latin. 9.
9. Write and test the following function: def pig_latin word): BEHERE NOUAWN Converts a word to Pig Latin. The conversion is: if a word begins with a vowel, add "way" to the end of the word. if the word begins with consonants, move the leading consonants to the end of the word and add "ay" to the end of that. "y" is treated as a consonant if it is the first character in the word, and as a vowel for anywhere else in the word. Preserve the case of the word i.e. if the first character of word is upper-case, then the new first character should also be upper case. Use: pl pig_latin(word) 14 Parameters: word - a string to convert to Pig Latin (str) Returns: pl - the Pig Latin version of word (str) Add this function to the PyDev module functions.py. Test it from t09.py. Word: car Pig-Latin: arcay Word: Bob Pig-Latin Obbay Word: track Pig-Latint acktray
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
