Collections.namedtuple()

  • + 0 comments
    1. from collections import namedtuple
    2. n = int(input())
    3. student = namedtuple('student',input())
    4. marks = 0
    5. for i in range(n):
    6. a,b,c,d = input().split()
    7. stu = student(a,b,c,d)
    8. stu_update = stu._replace(MARKS=int(stu.MARKS))
    9. marks += stu_update.MARKS
    10. print(round((marks/n),2))