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 "
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"
Step by step
Solved in 8 steps with 4 images