Question: I need help with this coding!!! This is Python 1. Write a function matching_sentences(file_name, word)) that takes two string parameter: 1. file_name - name of

I need help with this coding!!! This is Python
1. Write a function matching_sentences(file_name, word)) that takes two string parameter: 1. file_name - name of file to process. 2. word - a word to search for in the file 2. This problem is different from the scan_for in that we need to find any sentence that starts with the given word. 3. The function prints a message as displayed in the examples below. 4. Also note that sentence and line are not the same. A line can contain more than 1 sentence, and a sentence can span more than 1 line. Examine the data file and find a character or character group that delimits each sentence. 5. Hint: depending on how you decide to chop up the text into sentences, the first word in some sentences may contain undesirable characters. Consider using strip() if this happens. 6. Examples: >>> matching_sentences('bike.txt', 'when') 2 sentences begin with when >>> matching_sentences ('bike.txt', 'I') 1 sentences begin with I >>> matching_sentences ('bike.txt', 'From') O sentences begin with From
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
