Question: USE PYTHON AND FOLLOW RULES PLEASE. For the purposes of this question, we will define a word as ending a sentence if that word is
USE PYTHON AND FOLLOW RULES PLEASE.
For the purposes of this question, we will define a word as ending a sentence if that word is immediately followed by a period. For example, in the text "This is a sentence. The last sentence had four words.", the ending words are sentence and words. In a similar fashion, we will define the starting word of a sentence as any word that is preceded by the end of a sentence. The starting words from the previous example text would be "The". You do not need to consider the first word of the text as a starting word. Write a program that has: 1. A startwords function that takes a single string argument. This function must return a list of all sentence starting words that appear in the given string. There should be no duplicate entries in the returned list. 2. An endwords function that takes a single string argument. This function must return a list of all sentence ending words that appear in the given string. There should be no duplicate entries in the returned list and the periods should not be included in the ending words. Save your function code into a file called sentences.py that only includes the functions and necessary variables (i.e., no testing code) and add it to your submission zip. You can test this program in a similar fashion to the program from Problem 1. A sentencetester.py file has also been added to cuLearn to aid in testing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
