很快地写出来,请各方高手指教改进...
#准备资料
x = [list(range(i)) for i in range(10, 0, -1)]
del x[3]
del x[6]
for i,d in enumerate(x): #印出原先的资料
print(d)
#
rst = []
for i in range(len(x[0])):
r = []
for j in range(len(x)):
if x[j] == []:
break
else:
r.append(x[j][0]) # 放进去后
del x[j][0] # 就删除掉
rst.append(r)
print('