Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Python do the following: A: The text below misses a separator between the course and the grades. Create a regular expression to extract all

In Python do the following:

A: The text below misses a separator between the course and the grades. Create a regular expression to extract all the grades from the text and assign that value to the variable avg_grade.

text = """Intro_to_Python6.5 Calculus8.0 Advanced_deep_learning8.3 Compiler_construction6.0 """

Using:

regex = re.compile(pattern, flags=re.IGNORECASE) result = regex.findall(text)

B: Write a regular expression that extracts the sender, recipient and the subject from the email.

text = """From: Adam To: my classmates Subject: We can do better! Body: Focus hard, and we will be fine. """

Using the output:

print('{} says "{}" to {}'.format(result[0], result[2], result[1]))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Office 365 For Beginners 2022 8 In 1

Authors: James Holler

1st Edition

B0B2WRC1RX, 979-8833565759

More Books

Students also viewed these Databases questions

Question

=+5. What are their resources?

Answered: 1 week ago

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago