Write A python program to return all matches for a given search keyword to return the matched indexes. Hint use string.find(search, begin, end) recursively or in interation
PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU
def findMatch(sentence,text):
i=0
while(i<len(sentence)):
n = sentence.find(text,i,len(sentence))
if(n!=-1):
return n
i+=1
return -1
print(findMatch("My name is nikhil","nikhil"))
Get Answers For Free
Most questions answered within 1 hours.