Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the function with Python, Thanks!!!!! Question 4: 3 Marks Pig Latin is a game that children often play. It is a way of encoding
Write the function with Python, Thanks!!!!!
Question 4: 3 Marks Pig Latin is a game that children often play. It is a way of encoding a word that can be described by two simple rules: If the word begins with a vowel ('a'. e' ''. 'o' or ''), add 'yay' to the end of the word. If the word begins with a consonant (the otr letters), take all the consonants before the first vowel, add them to the end of the word, and then add 'ay' to the end of the word Question 4: Write a function pig.latinify(n): that takes a word n and returns its Pig Latin equivalent. For example: If alrdvArk', pig.latinify(n) should return 'aArdvArkyay' If 'vombat', pig latinify(n) should return 'ombatway If n'Thylacine', pig latinify(n) should return 'acineThylay A skeleton file called problem4.py is provided (it will be on the desktop) You should write your solution into this file You can assume that n is a non-empty string and contains at least 1 vowel. Your function should return a value of type str Your function should work correctly for letters in both upper and lower case (and a mixture) Your function should preserve capitalisation, ie. each letter in the Pig Latin version should be the same case as it was in n. The added 'ay" or 'yay' should be lower case. You must write your solution in the ile called problead.py found on the desktop The function that you write must be named pig.latinify and it must take one parameter Remember that your solution file must contain only function definitions, comments, and optionally import statements. If it contains anything else, it is invalid and you will receive zero marks. If you run the testing program, it will tell you if your file is invalidStep 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