I came across this snippet on Grepper:
line = "" d = ">" s = [e+d for e in line.split(d) if e] print(s) #Output: #