Python: Dictionary: Csv To Dict

Write the function csv_to_dict that takes the file path to a csv file (.csv) and returns to a list of dictionaries from the content of the csv file. The first row of the csv always contains the column names. No external library cannot be used. All tests would fail if any library is imported in your solution.

filepath = 'information.csv'
csv_to_dict(filepath) -> [{'name': 'Sarah', 'age': 15, 'gender': 'female'}, 
                          {'name': 'Dave', 'age': 20, 'gender': 'male'},
                          {'name': 'Noah', 'age': 31, 'gender': 'male'}]

Test 1    

Test 2    

Test 3    

Test 4