Question
Using python 3. def simple_pig_latin(input, sep= , end=.): Accept a string input, which might include multiple words separated by a separator sep and perform the
Using python 3.
def simple_pig_latin(input, sep=" ", end="."): Accept a string input, which might include multiple words separated by a separator sep and perform the following steps:
o Find the list of words (Note: words are just zero or more characters separated by a symbol. So, depending on the separator ' ' or 'a..b' could be a word.).
o Inspect every word and apply the following conversions: if the word starts with a non-letter or contains no characters, do nothing to it if the word starts with a vowel, add 'way' to the end if the word starts with a consonant, place the first letter at the end and add 'ay'
o Reassemble the words back into one string and return it, making sure a single sep is padded between any two neighboring words and the final string ends with end.
o Assume: the input does not have any capital letters o Go ahead and use string methods like .join(), .split()
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