arr = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
-
列表推导式
rst = [x for i in arr for x in i]
-
sum
rst = sum(arr, [])
-
itertools
from itertools import chain rst = list(chain.from_iterable(arr))
-
operator
import operator from functools import reduce rst = reduce(operator.add, arr)