向量内积
from operator import mul
x = [4, 6, 9]
y = [2, 2, 7]
print(sum(map(mul, x, y)))
相当于
x = [4, 6, 9]
y = [2, 2, 7]
print(sum((i*j for i, j in zip(x, y))))
两个等长的向量对应元素相加
from operator import add
x = [4, 6, 9]
y = [2, 2, 7]
print(list(map(add, x, y)))