import numpy as np
C = []
C.append([1,2])
C.append([1,2,3,4])
C.append([1,2])
C.append([1,5,3,6,9])
m = []
n = []
temp = []
res = []
for x in C:
m.append(len(x))
n.append(len(x))
m.sort(reverse=True)
index = 0
for i in m:
temp.append(C[n.index(i)])
n[n.index(i)] = []
for x in temp:
index += 1
if index <= 150:
res.append(x)
print(res)
python 二维list根据内容长度排序
最新推荐文章于 2021-08-19 16:03:05 发布