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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started