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

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

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