📜  展平嵌套列表 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:15.783000             🧑  作者: Mango

代码示例1
def flatten(x):
    if isinstance(x, list):
        return [a for i in x for a in flatten(i)]
    else:
        return [x]