We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Dot and Cross
- Discussions
Dot and Cross
Dot and Cross
Sort by
recency
|
317 Discussions
|
Please Login in order to post a comment
Simple Solution using matmul function from numpy
import numpy as np a1=[] a2=[] j=0 n=int(input()) for i in range(n*2): np1=np.array(list(input().split()),dtype=int) if j else: a2.append(np1) j+=1 print (np.dot(a1, a2))