我的清单有问题。我有一个包含许多子列表的列表。这看起来像这样:
L=[[1,5],[1,1,2,8,5,6],[6,46,35,86,24,3,34,46,23,35],[12,14,53,24,41,53],[1,3,6,4,3,8],[2,5,54,4,61,72,65,54],[43,6,2,6,51,3,43,13,64,52,5,8,3,57,52]]
我想要的是这样的:
L1=[1,5]
L2=[1,1,2,8,5,6]
L3=[6,46,35,86,24,3,34,46,23,35]
L4=[12,14,53,24,41,53]
L5=[1,3,6,4,3,8]
...
我试过了itertools.groupby()
,但这只是给了我:
L=[[[1,5],[1,1,2,8,5,6],[1,3,6,4,3,8]],[6,46,35,86,24,3,34,46,23,35],[12,14,53,24,41,53],[2,5,54,4,61,72,65,54],[43,6,2,6,51,3,43,13,64,52,5,8,3,57,52]]
我怎样才能做我想做的事?