Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python import re and use regex Replace the word Boy/Girl or boy/girl with Man/Woman. 1. Boy/Girl or boy/girl should be replaced with Man/Woman if the

Python import re and use regex

Replace the word Boy/Girl or boy/girl with Man/Woman.

1. Boy/Girl or boy/girl should be replaced with Man/Woman if the word prior to it is a name (starts with a capital letter)

Here are some examples:

Spider Girl, I need help!

Should return

Spider Woman, I need help!

There is a boy trapped in a burning building Iron Boy

Should return

There is a boy trapped in a burning building Iron Man

This is because the first boy is not proceeded by a word that has a Capital letter

Be careful not to return extra spaces in the final output. You may need to do a little bit of extra processing of the string captured by your group to ensure this. You will receive partial credit for having unwanted spaces. Please remove extra spaces for full credit.

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

Step: 3

blur-text-image

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

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago