Python zip() function

Author: Al-mamun Sarkar Date: 2020-03-26 13:53:41

Python zip() function. The following code shows how to solve the HackerRank Zipped! Python collections problem. 

Code:

n, x = map(int, input().split()) 

sheet = []
for _ in range(x):
    sheet.append(map(float, input().split()))

for i in zip(*sheet): 
    print(sum(i)/len(i))

 

Test Input:

5 3
80 90 70 93 80
80 91 87 88 86  
91 90 82 89 90.5

Test Output:

90.0
91.0
82.0
90.0
85.5