Light Mode
Dark Mode
How find index all give string??

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((

Created: May 18, 2020, 2:29 p.m.
Updated: May 18, 2020, 3:54 p.m.
0
8
User avatar
lowwro