A = [1,2,3,4,5,6]
B = [2,2,2,2,2,2]
# with numpyimport numpy as np
np.dot(A,B) # 42
np.sum(np.multiply(A,B)) # 42#Python 3.5 has an explicit operator @ for the dot product
np.array(A)@np.array(B)# 42# without numpysum([A[i]*B[i] for i inrange(len(B))]) # 42