Question: (Python) Preprocessing function: Write a function that gets a sentence or a text as an input parameter and removes all period (.), comma (,), colon

(Python) Preprocessing function: Write a function that gets a sentence or a text as an input parameter and removes all period (.), comma (,), colon (:), and semicolon (;) marks from the sentence. (Note: use the replace function). It also changes the text to lowercase. For example, if the following sentence is given as an input to the function: welcome, this is my favorite course: python data analytics; I hope you like it. The returning result must be: welcome this is my favorite course python data analytics i hope you like it. As you can see the order of the words and spaces between them are preserved, but punctuation marks are removed. In other words, let the methods name be preprocess, then, if the method is called as shown below: preprocess(this, is my: first. class.) The following result must be returned: this is my first class

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!