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 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
Get step-by-step solutions from verified subject matter experts
