2024-10-15 【python3】リストの中にリストが入っているとき(多次元リスト)に全部展開する python ■ 参考 : Pythonでflatten(多次元リストを一次元に平坦化) sumでもできるらしい importしなくても使えるのが便利 l_2d = [[0, 1], [2, 3]] print(sum(l_2d, [])) # [0, 1, 2, 3]