D = []
def move_list(a):
for i in a :
if type(i) != list:
D.append(i)
else:
move_list(i)
s=[1,[12,[1,[1,23,4,[1,2,[3]]]]],[3,[1,[2,645,[3,5,[456,[4,[45,7,[2,[[[[[[5]]]]]]]]]]]]],4]]
move_list(s)
print(D)
转载于:https://www.cnblogs.com/hdwen/p/7396960.html