问题 I need to flatten all the levels of a multi-level list: import itertools pool = [[[[[0,2],[1,3]],[[3,2],[1,0]]],"PdPd","PrisonerDilemma"], [[[[0,3],[1,2]],[[2,3],[1,0]]],"ShSh","StagHunt"], [[[[1,2],[3,0]],[[3,2],[1,0]]],"ChCh","Chicken"], [[[[2,1],[0,3]],[[3,1],[0,2]]],"BaBa","Battle"]] def flat3 (pool): for game in pool: l = list(itertools.chain.from_iterable(game[0])) print(l) The result: flat3 (pool) [[0, 2], [1, 3], [3, 2], [1, 0]] [[0, 3], [1, 2], [2, 3], [1, 0]] [[1, 2], [3, 0], [3, 2]