# Import required module/s
import csv

def readMarkSheet(file_name):
	"""Reads the input CSV file of Mark Sheet and creates a mapping of student name with his/her marks for each subject.

	Parameters
	----------
	file_name : str
		CSV file name of Mark Sheet

	Returns
	-------
	dict
		Mapping of each student's name and his/her marks for each subject as { Key : Value } pair
	
	Example
	-------
	>>> csv_file_name = 'task1_sample.csv'
	>>> print( readMarkSheet( csv_file_name ) )
	{
		'<NAME>': {'marks': [43.0, 71.0, 55.0, 16.0, 51.0]}, '<NAME>': {'marks': [49.0, 7.0, 53.0, 50.0, 63.0]}, 
		'<NAME>': {'marks': [63.0, 37.0, 21.0, 87.0, 9.0]}, '<NAME>': {'marks': [22.0, 3.0, 91.0, 75.0, 52.0]}, 
		'<NAME>': {'marks': [71.0, 90.0, 96.0, 79.0, 48.0]}, '<NAME>': {'marks': [71.0, 31.0, 83.0, 1.0, 25.0]}, 
		'<NAME>': {'marks': [92.0, 9.0, 2.0, 78.0, 55.0]}, '<NAME>': {'marks': [25.0, 78.0, 46.0, 46.0, 90.0]}, 
		'<NAME>': {'marks': [91.0, 96.0, 98.0, 94.0, 100.0]}, '<NAME>': {'marks': [34.0, 75.0, 51.0, 38.0, 99.0]}
	}
	"""

	name_marks_mapping = {}
	input_file_obj = open(file_name, 'r')

	##############	ADD YOUR CODE HERE	##############
	
	

	##################################################
	
	input_file_obj.close()

	return name_marks_mapping


def generateGradeCard(mapping_dict):
	"""Generate the Grade Card for all students in the given mapping of student and their scores in all subjects with the grade each one has received.

	Parameters
	----------
	mapping_dict : dict
		Mapping of each student's name and his/her marks for each subject as { Key : Value } pair

	Returns
	-------
	dict
		Grade Card for all students with their scores in all subjects and the grade each one has received
	
	Example
	-------
	>>> name_marks_mapping = {
								'<NAME>': {'marks': [43.0, 71.0, 55.0, 16.0, 51.0]}, '<NAME>': {'marks': [49.0, 7.0, 53.0, 50.0, 63.0]}, 
								'<NAME>': {'marks': [63.0, 37.0, 21.0, 87.0, 9.0]}, '<NAME>': {'marks': [22.0, 3.0, 91.0, 75.0, 52.0]}, 
								'<NAME>': {'marks': [71.0, 90.0, 96.0, 79.0, 48.0]}, '<NAME>': {'marks': [71.0, 31.0, 83.0, 1.0, 25.0]}, 
								'<NAME>': {'marks': [92.0, 9.0, 2.0, 78.0, 55.0]}, '<NAME>': {'marks': [25.0, 78.0, 46.0, 46.0, 90.0]}, 
								'<NAME>': {'marks': [91.0, 96.0, 98.0, 94.0, 100.0]}, '<NAME>': {'marks': [34.0, 75.0, 51.0, 38.0, 99.0]}
							}
	>>> print( generateGradeCard( name_marks_mapping ) )
	{
		'<NAME>': {'subject_wise_marks': [43.0, 71.0, 55.0, 16.0, 51.0], 'grade_received': 'D'}, 
		'<NAME>': {'subject_wise_marks': [49.0, 7.0, 53.0, 50.0, 63.0], 'grade_received': 'D'}, 
		'<NAME>': {'subject_wise_marks': [63.0, 37.0, 21.0, 87.0, 9.0], 'grade_received': 'D'}, 
		'<NAME>': {'subject_wise_marks': [22.0, 3.0, 91.0, 75.0, 52.0], 'grade_received': 'D'}, 
		'<NAME>': {'subject_wise_marks': [71.0, 90.0, 96.0, 79.0, 48.0], 'grade_received': 'A'}, 
		'<NAME>': {'subject_wise_marks': [71.0, 31.0, 83.0, 1.0, 25.0], 'grade_received': 'D'}, 
		'<NAME>': {'subject_wise_marks': [92.0, 9.0, 2.0, 78.0, 55.0], 'grade_received': 'D'}, 
		'<NAME>': {'subject_wise_marks': [25.0, 78.0, 46.0, 46.0, 90.0], 'grade_received': 'C'}, 
		'<NAME>': {'subject_wise_marks': [91.0, 96.0, 98.0, 94.0, 100.0], 'grade_received': 'O'}, 
		'<NAME>': {'subject_wise_marks': [34.0, 75.0, 51.0, 38.0, 99.0], 'grade_received': 'C'}
	}
	"""

	grade_card = {}

	##############	ADD YOUR CODE HERE	##############
	
	

	##################################################

	return grade_card


if __name__ == "__main__":
	"""Main function, code begins here.
	"""
	csv_file_name = 'task1_sample.csv'
	name_marks_mapping = readMarkSheet(csv_file_name)
	print(name_marks_mapping)
	grade_card = generateGradeCard(name_marks_mapping)
	print(grade_card)
