=====Function Descriptions=====
collections.namedtuple()

Basically, namedtuples are easy to create, lightweight object types.
They turn tuples into convenient containers for simple tasks.
With namedtuples, you don’t have to use integer indices for accessing members of a tuple.

Example
Code 01
>>> from collections import namedtuple
>>> Point = namedtuple('Point','x,y')
>>> pt1 = Point(1,2)
>>> pt2 = Point(3,4)
>>> dot_product = ( pt1.x * pt2.x ) +( pt1.y * pt2.y )
>>> print dot_product
11

Code 02
>>> from collections import namedtuple
>>> Car = namedtuple('Car','Price Mileage Colour Class')
>>> xyz = Car(Price = 100000, Mileage = 30, Colour = 'Cyan', Class = 'Y')
>>> print xyz
Car(Price=100000, Mileage=30, Colour='Cyan', Class='Y')
>>> print xyz.Class
Y

=====Problem Statement=====
Dr. John Wesley has a spreadsheet containing a list of student's IDs, marks, class and name.
Your task is to help Dr. Wesley calculate the average marks of the students.
Average = Sum of all marks / Total students

Note:
1. Columns can be in any order. IDs, marks, class and name can be written in any order in the spreadsheet.
2. Column names are ID, MARKS, CLASS and NAME. (The spelling and case type of these names won't change.)

=====Input Format=====
The first line contains an integer N, the total number of students.
The second line contains the names of the columns in any order.
The next N lines contains the marks, IDs, name and class, under their respective column names.

=====Constraints=====
0<N≤100

=====Output Format=====
Print the average marks of the list corrected to 2 decimal places.

Difficulty: introductory

Starter code:

# Enter your code here. Read input from STDIN. Print output to STDOUT

Solutions:
n = int(input())
col_list = list(input().split())
marks_col = col_list.index("MARKS")
marks_list = []
for i in range(n):
    info_list = list(input().split())
    marks_list.append(float(info_list[marks_col]))
print((sum(marks_list)/n))


#!/usr/bin/env python3

from collections import namedtuple

def __starting_point():
    s_num = int(input().strip())
    tuple_fields = input().strip().split()
    
    student = namedtuple('student', tuple_fields)
    library = []
    res = 0
    
    for _ in range(s_num):
        st_info = input().strip().split()
        library.append(student(st_info[0], st_info[1], st_info[2], st_info[3]))
        
    for el in library:
        res += int(el.MARKS)
    
    print(res/s_num)
__starting_point()