Question: 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

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 invalid

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 Databases Questions!