import re
alist = [[1, 2, 3, [4]], [1, [5, [3, 1]]]]
res = list(map(float, re.findall("\d+", str(alist))))
print(res)
Python 取出嵌套列表中的数字
Guess you like
Origin blog.csdn.net/x1131230123/article/details/120562456
Recommended
Ranking