Im trying to add every substring that occurs in my list, so in the word "hello" it would return [2,3] as the index values found in the string. I don't know how to have it re-iterate after every substring is found.
def myFind(string,substring):
if (string.find(substring) == -1):
return []
i = 0
list = []
while i < len(string):
x = string.find(substring)
list.append(x)
i +=1
return list
print (myFind("Hello","l"))