Sort by

recency

|

532 Discussions

|

  • + 0 comments
    n = list(map(int, input().split()))
    a = []
    for i in range(n[1]):
         arr = list(map(float, input().split()))
         a.append(arr)
    zipped = zip(*a)
    for group in zipped:
        print(sum(group)/len(group))
    
  • + 0 comments
    n, x = map(int, input().split())
    
    print(*list(map(lambda y: sum(y)/x, zip(*[map(float, input().split()) for _ in range(x)]))), sep="\n")
    
  • + 0 comments
    n, x = map(int, input().split())
    marks = []
    
    for i in range(x):
        marks.append(list(map(float, input().split())))
    
    for i in range(n):
        lis = list(zip(*marks))
        print(sum(lis[i]) / x)
    
  • + 0 comments

    Here's my code

    n, x = map(int, input().split())
    print(*map(lambda i: sum(i)/len(i), zip(*[list(map(float, input().split()))[:n] for _ in range(x)])), sep='\n')
    
  • + 0 comments

    if name == 'main':

    N , X = map(int , input().split())
    
    subjects = []
    
    
    for i in range(X):
    
        subjects.append(list(map(float , input().split())))
    
    
    
    result = list(zip(*subjects))
    
    
    for j in result:
    
        final_result = sum(j)/len(j)
        print("{:.1f}".format(final_result))