Sum and Prod

Sort by

recency

|

364 Discussions

|

  • + 0 comments
    import numpy as np
    
    n, m = map(int, input().split(' '))
    
    arr = []
    
    for i in range(n):
        row = list(map(int, input().split(' ')))
        
        arr.append(row)
        
    print(np.prod(np.sum(arr, axis=0)))
    
  • + 0 comments

    import numpy as np

    n , m = map(int,input().split(' '))

    arr = np.array([list(map(int,input().split(' '))) for _ in range(n)])

    sum = np.sum(arr, axis = 0) print(np.prod(sum))

  • + 0 comments

    import numpy as np

    n , m = map(int,input().split(' '))

    arr = np.array([list(map(int,input().split(' '))) for _ in range(n)])

    print(np.prod(np.sum(arr,axis=0)))

  • + 0 comments
    • import numpy
    • n,m = map(int,input().split())
    • isha = [list(map(int,input().split())) for _ in range(n)]
    • jinx = numpy.array(isha)
    • powpow = numpy.sum(jinx,axis=0)
    • powder = numpy.prod(powpow)
    • print(powder)
  • + 0 comments

    For Python3 Platform

    from numpy import array, sum, product
    
    n, m = map(int, input().split())
    arr = []
    
    for i in range(n):
        arr.append(list(map(int, input().split())))
    arr = array(arr)
    
    print(product(sum(arr, axis=0)))