what is split() without anything code example
Example 1: 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>"]
Example 2: python split word into letter pairs
s = 'abcdef'
L = zip(s[::2], s[1::2])
# -> [('a', 'b'), ('c', 'd'), ('e', 'f')]