示例:
s=" 300 january 10 20 "
mylist = s.split()
mylist = ['300', 'january', '10', '20']
如何创建一个列表,在分割之前添加元素的字符串位置:
mylistStringPos = [['300',startpos:endpos],...]
mylistStringPos = [['300',2:5], '['january',12:19]', '['10',25:27]', '['20',34:36]']]
Python有没有办法做到这一点?