如何將列表組合成一個數字/如何將數字拆分爲列表

如何將列表裏面的數字,合併成一個數字: 使用reduce(function,list)python from functools import reduce x = [1,2,3,4,5] combine = reduce((lambda x,y : x*10 + y),x) print(combine) #result: 12345 如何將一個數字, 拆分爲單個數字的列表: 使用map(fun
相關文章
相關標籤/搜索