python 二維數組轉一維數組

import operator from functools import reduce a = [[1,2,3], [4,6], [7,8,9,8]] print(reduce(operator.add, a)) >>> [1, 2, 3, 4, 6, 7, 8, 9, 8]
相關文章
相關標籤/搜索