Question: # This function will go over the text # and count the number of occurances of a given word def count_word(text, word): What it

# This function will go over the text # and count the number of occurances of a given word

def count_word(text, word): """ What it takes? a text to be searched a word to be searched within a text

what it does? finds how many times a word occurs in a text for example, the text is

'I like to play football. I also like to watch football. My favorite football team is Eagles.'

let's say the word to be searched is football. then, the function should return 3.

What it returns? return the number of word counts in a text. It will return an integer if the word does not in the text, return -1. """ # your code goes in here return

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!