About initial programming in python: a) Given a text stored in a string, make the function that counts the number of sentences that appear in this text. Each sentence in the text is ended with a end dot (.), an exclamation point (!), a question mark (?) or ellipses (...). Exclamation or question marks no will appear repeated sequentially in the text and these symbols only appear in the text ending a sentence. In the following example, 4 sentences are told: “I need to take a nap. My God! What time is it? I'm going miss my class..."   b) Make a function that, given a sentence, returns the sentence where all punctuation characters (including  dashes, comma, colon, semicolon, in addition to the sentence closing punctuation) have been replaced by space. example:  sentence read: "Wow, how i like chocolate." returned setence: "Wow  how i like chocolate "

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.2: Returning A Single Value
Problem 6E
icon
Related questions
Question

About initial programming in python:

a) Given a text stored in a string, make the function that counts the number of sentences that appear in this text. Each sentence in the text is ended with a end dot (.), an exclamation point (!), a question mark (?) or ellipses (...). Exclamation or question marks no will appear repeated sequentially in the text and these symbols only appear in the text ending a sentence.
In the following example, 4 sentences are told: “I need to take a nap. My God! What time is it? I'm going miss my class..."

 

b) Make a function that, given a sentence, returns the sentence where all punctuation characters (including 
dashes, comma, colon, semicolon, in addition to the sentence closing punctuation) have been replaced by space.

example: 

sentence read: "Wow, how i like chocolate."

returned setence: "Wow  how i like chocolate "

 

c) Make a function that given a sentence returns another sentence that contains the same words as the sentence input in reverse order, with no capital letters, and no punctuation.
TIP: Remove punctuation from the sentence, using the function you made for the previous exercise. 
Example:
sentence read: "Wow, how i like chocolate."
changed sentence: "chocolate like i how wow"

Expert Solution
steps

Step by step

Solved in 8 steps with 4 images

Blurred answer
Similar questions
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning