Question: Python 3 Exercise 9. Substrings. Write a function substring(s1, s2, k) that takes two strings and an integer index k, and returns True if the

Python 3
Exercise 9. Substrings. Write a function substring(s1, s2, k) that takes two strings and an integer index k, and returns True if the first string appears as a substring in the second starting at location k, and False otherwise. You may assume that all strings consist of lowercase characters only. Write a function how_many() that takes two strings and returns the number of times the first string occurs in the second. Again, you may assume that all strings consist of lowercase characters only. For example, the call how many("bob", "azcbobobegghaki") should return 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
