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
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