=====Function Descriptions=====
dot

The dot tool returns the dot product of two arrays.

import numpy

A = numpy.array([ 1, 2 ])
B = numpy.array([ 3, 4 ])

print numpy.dot(A, B)       #Output : 11

cross

The cross tool returns the cross product of two arrays.

import numpy

A = numpy.array([ 1, 2 ])
B = numpy.array([ 3, 4 ])

print numpy.cross(A, B)     #Output : -2

=====Problem Statement=====
You are given two arrays A and B. Both have dimensions of NXN.
Your task is to compute their matrix product.

=====Input Format=====
The first line contains the integer N.
The next N lines contains N space separated integers of array A.
The following N lines contains N space separated integers of array B.

=====Output Format=====
Print the matrix multiplication of A and B.

Difficulty: introductory

Starter code:

import numpy

Solutions:
import numpy
n = int(input())
ar1 = []
ar2 = []
for i in range(n):
    tmp = list(map(int,input().split()))
    ar1.append(tmp)
np_ar1 = numpy.array(ar1)
for i in range(n):
    tmp = list(map(int,input().split()))
    ar2.append(tmp)
np_ar2 = numpy.array(ar2)
print((numpy.dot(np_ar1,np_ar2)))


import numpy as np

n = int(input().strip())
arr1 = np.array([[int(x) for x in input().strip().split()] for _ in range(n)])
arr2 = np.array([[int(x) for x in input().strip().split()] for _ in range(n)])

print(np.dot(arr1, arr2))