Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Real Time Database Systems Architecture And Techniques

Authors: Kam-Yiu Lam ,Tei-Wei Kuo

1st Edition

1475784023, 978-1475784022

More Books

Students also viewed these Databases questions

Question

1. Signs and symbols of the map Briefly by box ?

Answered: 1 week ago

Question

Types of physical Maps?

Answered: 1 week ago

Question

Explain Intermediate term financing in detail.

Answered: 1 week ago