Python 两个list相减
2020-07-22 本文已影响0人
朱佩奇被占用
两个list相减
data1 = [234,333,212]
data2= [544, 123, 765]
#data3 = data2- data1
# Error: TypeError: unsupported operand type(s) for -: 'list' and 'list'
data3 = list(map(lambda x: x[0]-x[1], zip(data2, data1)))