HackerRank- Python Sum and Prod



Calculate product and sum of a 2-D array



  1. import numpy
  2. N, M = map(int, input().split())
  3. A = numpy.array([input().split() for _ in range(N)],int)
  4. print(numpy.prod(numpy.sum(A, axis=0), axis=0))

download android app