We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Sum and Prod
- Discussions
Sum and Prod
Sum and Prod
Sort by
recency
|
348 Discussions
|
Please Login in order to post a comment
Simple code from my side..
import numpy as np
N,M = list(map(int, input().split())) ll=[] for i in range(N): arr=np.array(list(map(int, input().split()))) ll.append(arr) a3=np.sum(ll, axis = 0) print(np.prod(a3))
Enter your code here. Read input from STDIN. Print output to STDOUT
import numpy as np
def map_func(y): return map(int, y.split())
def sum_prod(x): N, M = map_func(x) array = (np.array([list(map_func(input())) for _ in range(N)])) print(np.prod(np.sum(array, axis = 0)))
sample_input = input() sum_prod(sample_input)