You are viewing a single comment's thread. Return to all comments →
in 4 lines using namedtuple without violating PEP8:
from collections import namedtuple (n, categories) = (int(input()), input().split()) Grade = namedtuple('Grade', categories) marks = [int(Grade._make(input().split()).MARKS) for _ in range(n)] print((sum(marks) / len(marks)))
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 →
in 4 lines using namedtuple without violating PEP8: