入れ子になっているリストから入れ子を外す方法2023/5/29 / 1 min readView more blogs with the tag pythonTable of Contents#はじめに#方法はじめに Pythonで入れ子になっているリストから入れ子を外す方法です。 方法 import itertools old_list = [[0, 1], [2, 3], [4, 5, 6]] new_list = list(itertools.chain.from_iterable(old_list))# -> [0, 1, 2, 3, 4, 5, 6]