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
Get step-by-step solutions from verified subject matter experts
