Question: Problem 1: Write a Python function, called cntWordOccur, that takes in two arguments Argument #1: It is a string that represents a string of one

Problem 1: Write a Python function, called cntWordOccur, that takes in two arguments Argument #1: It is a string that represents a string of one or more sentences. Argument #2: It is a string that represents a word. The function will count the number of times the word occurs in the sentences(s) and returns this value when called. You will return an integer value. Do not use the built-in function called cou nt def cntWordoccur (sentences, word): YOUR CODE GOES HERE >>> string of sentences- I like to eat lots and lots of ice cream" >>> word to find = lots" >>cntWordoccur(string of_sentences, word to find) Use the split0 function to separate the word of the string. The split0 function splits a string into a list. You can specify the separator. The default separator is any whitespace For example >>>string of sentences = I like to eat lots and lots of ice cream >>list_of_words string_of sentences.split() >print(list_of_words) I' , , , like , , , to, , 'eat', 'lots', 'lots, , , of, , , ice,' cream
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
