Question: PLEASE CODE IN PYTHON Task 2 Run the first cell of Task 2 in colab notebook, it defines the following string: s M'It was the

PLEASE CODE IN PYTHON

PLEASE CODE IN PYTHON Task 2 Run the first cell of Task

Task 2 Run the first cell of Task 2 in colab notebook, it defines the following string: s M'It was the best of times, it was the worst of times; it was the age of wisdom, it was the age of foolishness; it was the epoch of belief, it was the epoch of incredulity; it was (The beginning of A Tale of Two Cities by Charles Dickens.) Then do the following, in order: (a) Write a sequence of statements that produce a copy of s, named news, in which characters :,ii, and have been replaced by blank spaces. (b) Remove leading and trailing blank spaces in news (and name the new string newS). (c) Make all the characters in news lowercase (and name the new string news). (d) Compute the number of occurrences in news of string 'it was'. (e) Change every occurrence of was to is (and name the new string news)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!