一.需求原格式:input=[[1,2,3],[4,5,6],[7,8,9]]目标格式:[1, 2, 3, 4, 5, 6, 7, 8, 9]二.方法1.sum函数合并input=[[1,2,3],[4,5,6...2.reduce函数from functools import reduceinput=[[1,2,3],[4,5,6],[7,8,9]]output=reduce(list....,[4,5,6],[7,8,9]]ouput=list(itertools.chain(*input))print(ouput)#结果[1, 2, 3, 4, 5, 6, 7, 8, 9]三.性能对比python..., best of 3: 51.2 usec per looppython -mtimeit -s'l=[[1,2,3],[4,5,6], [7], [8,9]]*99' 'reduce(list....__add__,l)'1000 loops, best of 3: 572 usec per loop python -mtimeit -s'l=[[1,2,3],[4,5,6], [7], [8,9]