Question: Write a function that takes as input the file thehoundofthebaskervilles.txt and returns how many times names Holmes and Watson have been mentioned in the same

Write a function that takes as input the file "thehoundofthebaskervilles.txt" and returns how many times names Holmes and Watson have been mentioned in the same sentence. using python. The below paragraph is in the file.. can you put it in the file and show how to code them. 

Mr. Sherlock Holmes, who was usually very late in the mornings, save upon those not infrequent occasions when he was up all night, was seated at the breakfast table. I stood upon the hearth-rug and picked up the stick which our visitor had left behind him the night before. It was a fine, thick piece of wood, bulbous-headed, of the sort which is known as a Penang lawyer. Just under the head was a broad silver band nearly an inch across. To James Mortimer, M.R.C.S., from his friends of the C.C.H., was engraved upon it, with the date 1884. It was just such a stick as the old-fashioned family practitioner used to carry--dignified, solid, and reassuring.

Well, Watson, what do you make of it?

Holmes was sitting with his back to me, and I had given him no sign of my occupation.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!