Question: Create a function that takes two strings and returns a list of integer indexes. The returned list contains the indexes of each occurence of the
Create a function that takes two strings and returns a list of integer indexes. The returned list contains the indexes of each occurence of the substring. Do not use the built-in find function of strings. Arguments: my_str (str): A string to be searched using my_substr string. my_substr (str): The substring to be searched in my_str string. Returns: list: A list of integer indexes of each occurence of the substring. Examples: print(my_find('elementary', 't')) [6] print(my_find('computer', 'A')) [] print(my_find('Hello Hello Hello there', 'Hello')) [0, 6, 12] print(my_find('soon will I rest, yes, forever sleep', 'e')) [13, 19, 26, 28, 33, 34]
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
