CIS 41A Unit J, Problem J

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 variable 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 variable 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 to 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 variable named data.
Write a raw sting containing a regular expression that matches a space.
Use the split function to 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 variable 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"