1A = [1,2,3,4,5,6]
2B = [2,2,2,2,2,2]
3
4# with numpy
5import numpy as np
6np.dot(A,B) # 42
7np.sum(np.multiply(A,B)) # 42
8#Python 3.5 has an explicit operator @ for the dot product
9np.array(A)@np.array(B)# 42
10# without numpy
11sum([A[i]*B[i] for i in range(len(B))]) # 42
1a = np.array([[1,2],[3,4]])
2b = np.array([[11,12],[13,14]])
3np.dot(a,b)
4[[37 40], [85 92]]