Input Format
The first line of input contains space separated values of  and .
The next  lines contains  space separated integers.
Output Format
Compute the sum along axis . Then, print the product of that sum.

hackerrank sum and prod problem solution in python programming

Problem solution in Python 2 programming language.

import numpy
N, M = map(int, input().split())
my_array = numpy.array([ map(int, input().split()) for i in range(N) ])
print( numpy.sum( my_array, axis = 0 )))

Second solution

import numpy
N, M = map(intinput().split())
A = numpy.array([input().split() for _ in range(N)],int)
print(, axis=0), axis=0))

Problem solution in Python 3 programming language.

import numpy
N, M = map(int, raw_input().split())
my_array = numpy.array([ map(int, raw_input().split()) for i in range(N) ])
print numpy.sum( my_array, axis = 0 ) )