Question: Function name: count_ matches Parameters: sentence (str), substring (str) Returns; number of matches (int) Description: Write a function that takes in two strings and returns

 Function name: count_ matches Parameters: sentence (str), substring (str) Returns; number

Function name: count_ matches Parameters: sentence (str), substring (str) Returns; number of matches (int) Description: Write a function that takes in two strings and returns the number of times the substring occurs in the sentence. You will not be able to use find) or split) for this function. Test Case acount_matches("hello yellow jello mellow lollipop", "llo") >>>print(a) 4 bcount_matches("oysters are slimy", "yo") >>>print(b) 0

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!