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 "

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education