[Python]兩個list對應元素操做(相減)

兩個list的對應元素操做,這裏以相減爲例:python # coding=gbk v1 = [21, 34, 45] v2 = [55, 25, 77] #v = v2 - v1 # Error: TypeError: unsupported operand type(s) for -: 'list' and 'list' v = list(map(lambda x: x[0]-x[1]
相關文章
相關標籤/搜索