• How find index all give string??

Question related to mission Between Markers

 

CODE:

### ### def between_markers(text: str, begin: str, end: str) -> str:

first_index = text.find(begin)
second_index = text.find(end)
print (first_index)
print (second_index)    
if begin == None:
    return text[0: second_index]
elif begin == None and end == None:
    return text
elif second_index < first_index:
    return " "
else:
    return text[first_index +1 : second_index]

###### Need do output : "My new site"

assert between_markers("<head><title>My new site</title></head>", "<title>", "</title>") == "My new site", "HTML"

But i cant,because index == one symbol , not all "<title>

I don' know how to do((

8