This assignment consists of one script containing four parts. At the top of each of your problem put the following multi-line comment, with your information: Your name as registered, with optional nickname in parentheses CIS 41A Winter 2021 Unit J take-home assignment Problem J part 1 Read text input into a variabale named data Write a raw sting containing a regular expression that matches a lower case a. Use the search function to see if the variable data contains a match. Print found if found, otherwise print not found. Test twice: with two presidents of the United States: "Harry S. Truman" and then "Dwight D. Eisenhower". Problem J part 2 Read text input into a variabale named data. Write a raw sting containing a regular expression that contains a lower case b followed by a dot: 'b.' Use the findall function obtain a list of matching substrings. Print the resulting list. Test once with the string: "Dobby Rebeus Longbottom Gabrielle Albus" Problem J part 3 Read text input into a variabale named data. Write a raw sting containing a regular expression that matches a space. Use the split function obtain a list of substrings seperated by a space. Print the resulting list. Test once with the string: "Bill Charlie Percy Fred George Ron Ginny" Problem J part 4 Read text input into a variabale named data. Write a raw sting containing a regular expression that matches a lower case th Us the sub function to change 'th' to 'lore'. Print the resulting string. Test once with the string: "thlei, th, and folk tales"

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
icon
Concept explainers
Question

IN pyth coding please

This assignment consists of one script containing four parts.
At the top of each of your problem put the following multi-line comment, with your information:
Your name as registered, with optional nickname in parentheses
CIS 41A Winter 2021
Unit J take-home assignment
Problem J part 1
Read text input into a variabale named data.
Write a raw sting containing a regular expression that matches a lower case a.
Use the search function to see if the variable data contains a match. Print found if found, otherwise print not found.
Test twice: with two presidents of the United States: "Harry S. Truman" and then "Dwight D. Eisenhower".
Problem J part 2
Read text input into a variabale named data.
Write a raw sting containing a regular expression that contains a lower case b followed by a dot: 'b.'
Use the findall function obtain a list of matching substrings. Print the resulting list.
Test once with the string:
"Dobby Rebeus Longbottom Gabrielle Albus"
Problem J part 3
Read text input into a variabale named data.
Write a raw sting containing a regular expression that matches a space.
Use the split function obtain a list of substrings seperated by a space. Print the resulting list.
Test once with the string:
"Bill Charlie Percy Fred George Ron Ginny"
Problem J part 4
Read text input into a variabale named data.
Write a raw sting containing a regular expression that matches a lower case th
Us the sub function to change 'th' to 'lore'. Print the resulting string.
Test once with the string:
"thlei, th, and folk tales"
Transcribed Image Text:This assignment consists of one script containing four parts. At the top of each of your problem put the following multi-line comment, with your information: Your name as registered, with optional nickname in parentheses CIS 41A Winter 2021 Unit J take-home assignment Problem J part 1 Read text input into a variabale named data. Write a raw sting containing a regular expression that matches a lower case a. Use the search function to see if the variable data contains a match. Print found if found, otherwise print not found. Test twice: with two presidents of the United States: "Harry S. Truman" and then "Dwight D. Eisenhower". Problem J part 2 Read text input into a variabale named data. Write a raw sting containing a regular expression that contains a lower case b followed by a dot: 'b.' Use the findall function obtain a list of matching substrings. Print the resulting list. Test once with the string: "Dobby Rebeus Longbottom Gabrielle Albus" Problem J part 3 Read text input into a variabale named data. Write a raw sting containing a regular expression that matches a space. Use the split function obtain a list of substrings seperated by a space. Print the resulting list. Test once with the string: "Bill Charlie Percy Fred George Ron Ginny" Problem J part 4 Read text input into a variabale named data. Write a raw sting containing a regular expression that matches a lower case th Us the sub function to change 'th' to 'lore'. Print the resulting string. Test once with the string: "thlei, th, and folk tales"
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Query Syntax
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.
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