python keep string your spliting a string with code example
Example: python split string keep delimiter
line = "<html><head>"
d = ">"
s = [e+d for e in line.split(d) if e]
print(s)
#Output:
#["<html>", "<head>"]
line = "<html><head>"
d = ">"
s = [e+d for e in line.split(d) if e]
print(s)
#Output:
#["<html>", "<head>"]