A uwuified sentence is sentence that has been transformed using a made-up Internet language in which some of the letters in the words are replaced by something else. The exact scheme is described below: • Any uppercase/lowercase R or L is replaced by w/w, respectively. • If we encounter an o/o in a word, check if the previous letter (if it exists) is an M/m or N/n. If the previous letter is one of these, insert the lowercase letter y in between them, regardless of the capitalization of the other letters. • All other characters are left unchanged. Some examples: Professor will be converted to Pwofessow (There are two r's that are replaced by w's. Since the two o's aren't proceeded by an M/n or N/n, no y will be inserted.) LLunoacyo will be converted to wwunyoacyo (The two L's will be replaced with two ws according to the first rule. Then the first o will have a у inserted in front of it between then and the o according to the second rule. The last o won't have a y inserted in between because it is not preceded by an M/m Or N/n.) Write the function uwuify which takes in a sentence stored in the argument named sentence and then uwuifies the string according to the scheme described above. Examples: Function Call uwuify('Hello, Wolfie the Seawolf!') uwuify('My mom gave me sardines for lunch. :(') uwuify('LOLcats love fish!') uwuify('Nom nom, delicious!') uwuify('I can has cheezburger? CatMom says no.') [ ] Return Value Hewwo, Wowfie the Seawowf! My myom gave me sawdines fow wunch. :( WOWcats wove fish! Nyom nyom, dewicious! I can has cheezbuwgew? CatMyom says nyo. 1 def uwuify (sentence): 2 return 'Error' # DELETE THIS LINE and start coding here. 3 # Remember: end all of your functions with a return statement, not a print statement! 4 5 6 # Test cases 7 print (uwuify('Hello, Wolfie the Seawolf!')) 8 print (uwuify('My mom gave me sardines for lunch. :(')) 9 print (uwuify('LOLcats love fish!')) 10 print (uwuify('Nom nom, delicious!')) 11 print (uwuify('I can has cheezburger? CatMom says no.'))

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
A uwuified sentence is sentence that has been transformed using a made-up Internet language in which some of the letters in the words are
replaced by something else. The exact scheme is described below:
Any uppercase/lowercase R or L is replaced by w/w, respectively.
• If we encounter an o/o in a word, check if the previous letter (if it exists) is an M/m or N/n. If the previous letter is one of these, insert the
lowercase letter y in between them, regardless of the capitalization of the other letters.
• All other characters are left unchanged.
Some examples:
Professor will be converted to Pwofessow (There are two r's that are replaced by w's. Since the two o's aren't proceeded by an M/n or N/n,
no y will be inserted.)
LLunoacyo will be converted to wwunyoacyo (The two L's will be replaced with two ws according to the first rule. Then the first o will have a
y inserted in front of it between then and the o according to the second rule. The last o won't have a y inserted in between because it is not
preceded by an M/m Or N/n.)
Write the function uwuify which takes in a sentence stored in the argument named sentence and then uwuifies the string according to the
scheme described above.
Examples:
Function Call
uwuify('Hello, Wolfie the Seawolf!')
uwuify( 'My mom gave me sardines for lunch. :(')
uwuify('LOLcats love fish!')
uwuify('Nom nom, delicious!')
uwuify('I can has cheezburger? CatMom says no.')
[ ]
Return Value
Hewwo, Wowfie the Seawowf!
My myom gave me sawdines fow wunch. :(
WOWcats wove fish!
Nyom nyom, dewicious!
I can has cheezbuwgew? CatMyom says nyo.
1 def uwuify (sentence):
2
return 'Error' # DELETE THIS LINE and start coding here.
3
# Remember: end all of your functions with a return statement, not a print statement!
4
5
6 # Test cases
7 print (uwuify('Hello, Wolfie the Seawolf!'))
8 print (uwuify('My mom gave me sardines for lunch. :('))
9 print (uwuify('LOLcats love fish!'))
10 print (uwuify('Nom nom, delicious!'))
11 print (uwuify('I can has cheezburger? CatMom says no.'))
Transcribed Image Text:A uwuified sentence is sentence that has been transformed using a made-up Internet language in which some of the letters in the words are replaced by something else. The exact scheme is described below: Any uppercase/lowercase R or L is replaced by w/w, respectively. • If we encounter an o/o in a word, check if the previous letter (if it exists) is an M/m or N/n. If the previous letter is one of these, insert the lowercase letter y in between them, regardless of the capitalization of the other letters. • All other characters are left unchanged. Some examples: Professor will be converted to Pwofessow (There are two r's that are replaced by w's. Since the two o's aren't proceeded by an M/n or N/n, no y will be inserted.) LLunoacyo will be converted to wwunyoacyo (The two L's will be replaced with two ws according to the first rule. Then the first o will have a y inserted in front of it between then and the o according to the second rule. The last o won't have a y inserted in between because it is not preceded by an M/m Or N/n.) Write the function uwuify which takes in a sentence stored in the argument named sentence and then uwuifies the string according to the scheme described above. Examples: Function Call uwuify('Hello, Wolfie the Seawolf!') uwuify( 'My mom gave me sardines for lunch. :(') uwuify('LOLcats love fish!') uwuify('Nom nom, delicious!') uwuify('I can has cheezburger? CatMom says no.') [ ] Return Value Hewwo, Wowfie the Seawowf! My myom gave me sawdines fow wunch. :( WOWcats wove fish! Nyom nyom, dewicious! I can has cheezbuwgew? CatMyom says nyo. 1 def uwuify (sentence): 2 return 'Error' # DELETE THIS LINE and start coding here. 3 # Remember: end all of your functions with a return statement, not a print statement! 4 5 6 # Test cases 7 print (uwuify('Hello, Wolfie the Seawolf!')) 8 print (uwuify('My mom gave me sardines for lunch. :(')) 9 print (uwuify('LOLcats love fish!')) 10 print (uwuify('Nom nom, delicious!')) 11 print (uwuify('I can has cheezburger? CatMom says no.'))
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Time complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education