Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON ASSIGNMENT { cells: [ { metadata: { state: normal }, cell_type: markdown, source: # Assignment 5 }, { metadata: { state: normal }, cell_type:

PYTHON ASSIGNMENT image text in transcribed

image text in transcribed

{ "cells": [ { "metadata": { "state": "normal" }, "cell_type": "markdown", "source": "# Assignment 5" }, { "metadata": { "state": "normal" }, "cell_type": "markdown", "source": "In this assignment, you will analyze text using regular expressions in Python. The text you will use consists of Chapters 44 and 45 of Pride and Prejudice, by Jane Austen. After reading the text into a SINGLE STRING named \"chapterText\" (see the starter code for help with this), your job is to do the following: 1. Count the number of times that Lizzy (Elizabeth), Mr. Darcy, and Pemberley are mentioned in the text. The values should be stored in variables named \"lizzy\", \"darcy\", and \"pemberley\", respectively. 2. Replace all newline characters (\"\ \") with a single space (\" \"), and store the updated text in the same variable as the original text (overwrite the original string). 3. Store the starting point of each instance of the name Jane in a list called \"jane\". 4. Separate each sentence. Store all sentences in a list called \"sentences\". (This will require two consecutive \"negative lookbehind\" statements, which are defined using the characters \"? In this assignment, you will analyze text using regular expressions in Python. The text you will use consists of Chapters 44 and 45 of Pride and Prejudice, by Jane Austen. After reading the text into a SINGLE STRING named "chapterText" (see the starter code for help with this), your job is to do the following: 1. Count the number of times that Lizzy (Elizabeth), Mr. Darcy, and Pemberley are mentioned in the text. The values should be stored in variables named "lizzy", "darcy", and "pemberley", respectively. 2. Replace all newline characters (" ") with a single space (" "), and store the updated text in the same variable as the original text (overwrite the original string). 3. Store the starting point of each instance of the name Jane in a list called "jane". 4. Separate each sentence. Store all sentences in a list called "sentences". (This will require two consecutive "negative lookbehind" statements, which are defined using the characters "?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions