Array Mathematics

  • + 0 comments

    import numpy

    line=input() n=int(line.split()[0]) m=int(line.split()[1]) a=[] b=[] for i in range(n): m=list(map(int,input().split())) a.append(m)

    a=numpy.array(a)

    for i in range(n): m=list(map(int,input().split())) b.append(m)

    b=numpy.array(b)

    print(a+b) print(a-b) print(a*b) print(a//b) print(a%b) print(a**b)