Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started