>>> a="a,b,c,d,e"
>>> a.split(",")[0:2]
['a', 'b']
>>> a.split(",")[0:-2]
['a', 'b', 'c']
>>>
转载于:https://www.cnblogs.com/seasonsstory/p/3254703.html
>>> a="a,b,c,d,e"
>>> a.split(",")[0:2]
['a', 'b']
>>> a.split(",")[0:-2]
['a', 'b', 'c']
>>>
转载于:https://www.cnblogs.com/seasonsstory/p/3254703.html