Please Login in order to post a comment
n, x = map(int, input().split(' ')) marks= [ list(map(float, input().split())) for _ in range(x)] print(*[sum(i)/x for i in zip(*marks)], sep='\n')
n , x = map(int,input().split())
data = [list(map(float,input().split())) for _ in range(x)]
students = zip(*data)
for std in students: average = sum(std) / x print(average)
What's the advantage of using map() over a list comprehension? I find list comprehension easier to read
n, x = [int(i) for i in input().split()] subject = [] for _ in range(x): subject.append([float(i) for i in input().split()]) student = [ i for i in zip(*subject)] for stud in student: print(sum(stud)/x)
n,x =map(int,input().split()) marks = [] for subs in range(x): marks.append(list(map(float,input().split()))) zipd = list(zip(*marks)) for i in zipd: print(sum(i)/x)
N, X = list(map(int, input().split())) marks = [] for _ in range(X): marks.append(list(map(float, input().split()))) for sub in zip(*marks): print(round(sum(sub)/X,1))
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
n , x = map(int,input().split())
data = [list(map(float,input().split())) for _ in range(x)]
students = zip(*data)
for std in students: average = sum(std) / x print(average)
What's the advantage of using map() over a list comprehension? I find list comprehension easier to read