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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started