Question: Write a python module with two functions wordToPig and nameToPig. Your wordToPig function will take 1 parameter, a string, and convert the word passed in

Write a python module with two functions wordToPig and nameToPig.

Your wordToPig function will take 1 parameter, a string, and convert the word passed in to the parameter based on the below rules, returning the result.

Your nameToPig function takes 2 input parameters, firstName and lastName, and will use your wordToPig function internally to translate the names. Your nameToPig function returns the names in pig Latin.

Please use the following guidelines for Pig Latin:

Words beginning with consonants: move the consonant from the start of the word to the end of the word. Then add the suffix "ay" to the end of the word. For example, the word "Hello" would become Ellohay.

Words beginning with vowels: all you need to do is add "yay" to the end of the word. For example: the word "Egg" becomes Eggyay. Make sure to use string methods to have capital letters where appropriate and not otherwise. (Hello becomes Ellohay not elloHay.) Test your nameToPig function with two different names, both input from the user (there is no need to test your wordToPig function separately, as it is called within nameToPig). Assume the user enters his/her name with capitals for both their first and last name.

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!