需求:把嵌套的二级 list 展开成无嵌套 list,类似 flatmap 操作
l = [[0,1], [2,3]]
flattened_list = [item for subl in l for item in subl]
# => [0, 1, 2, 3]
需求:把嵌套的二级 list 展开成无嵌套 list,类似 flatmap 操作
l = [[0,1], [2,3]]
flattened_list = [item for subl in l for item in subl]
# => [0, 1, 2, 3]