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