HackerRank- Python Sum and Prod
Calculate product and sum of a 2-D array
- import numpy
- N, M = map(int, input().split())
- A = numpy.array([input().split() for _ in range(N)],int)
- print(numpy.prod(numpy.sum(A, axis=0), axis=0))
Calculate product and sum of a 2-D array
- import numpy
- N, M = map(int, input().split())
- A = numpy.array([input().split() for _ in range(N)],int)
- print(numpy.prod(numpy.sum(A, axis=0), axis=0))
Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.