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"

New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Patrick M. Carey
Chapter9: Getting Started With Javascript: Creating A Countdown Clock
Section: Chapter Questions
Problem 8CP4
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning