Array Mathematics

  • + 1 comment
    import numpy as np
    
    n, m = list(map(int,input().split()))
    
    a,b = [np.array([list(map(int,input().split())) for _ in range(n)]).reshape(n,m) for _ in range(2)]
    
    coms = '+ - * // % **'.split()
    
    [print(eval(f'a{com}b')) for com in coms]