You are viewing a single comment's thread. Return to all comments →
from collections import namedtuple n = int(input()) titles, lines = list(map(str, input().split())), [input() for i in range(n)] print(sum(list(map(int, [(namedtuple('Marks', f'{titles[0]} {titles[1]} {titles[2]} {titles[3]}')(ID=lines[i].split()[titles.index('ID')], MARKS=lines[i].split()[titles.index('MARKS')], NAME=lines[i].split()[titles.index('NAME')], CLASS=lines[i].split()[titles.index('CLASS')]).MARKS) for i in range(0, n)]))) / n)
Seems like cookies are disabled on this browser, please enable them to open this website
Collections.namedtuple()
You are viewing a single comment's thread. Return to all comments →