Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(b) Converting one word to Pig Latin is okay, but it would be more useful to be able to convert whole sentences; so for this
(b) Converting one word to Pig Latin is okay, but it would be more useful to be able to convert whole sentences; so for this part, use raw.input to ask the user for a full sentence and translate it, word by word. The pig latin converter should only return lowercase words. To avoid dealing with punctuation and numbers, ask the user to enter only words and spaces. If the user enters a sentence with punctuation or numbers, print an appropriate message to them. You can convert their input from a string to a list of strings by calling the split method on the entered string. You can also use the method lover to make the string all lowercase. See below for examples on how to use the split and lover methods: >>> phrase = My namE is Johil Salth word list phrase.splito >print word.list DMy, namE, is, JohN, SmIth ase. lower >>> print lowercase_phrase my name is john smith Finally, your program must be interactive: it keeps translating phrases into pig latin until the user enters the phrase QUIT
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