The link to the exercise: MOOC Python Course 2025 The Exercise: Let's expand the program created in the previous exercise. Now also the exam points awarded to each student are contained in a CSV file. The contents of the file follow this format: id;e1;e2;e3 12345678;4;1;4 12345687;3;5;3 12345699;10;2;2 In the above example the student whose student number is 12345678 was awarded 4+1+4 points in the exam, which equals a total of 9 points. The program should again ask the user for the names of the files. Then the program should process the files and print out a grade for each student. Sample output Student information: students1.csv Exercises completed: exercises1.csv Exam points: exam_points1.csv pekka peloton 0 jaana javanainen 1 liisa virtanen 3 Each completed exercise is counted towards exercise points, so that completing at least 10 % of the total exercices awards 1 point, completing at least 20 % awards 2 points, etc. Completing all 40 exercises awards 10 points. The number of points awarded is always an integer number. The final grade for the course is determined based on the sum of exam and exercise points according to the following table: exam points + exercise points -> grade 0-14 -> 0 (fail) 15-17 -> 1 18-20 -> 2 21-23 -> 3 24-27 -> 4 28- -> 5 The exercise expects the output to be: pekka peloton 0 jaana javanainen 1 liisa virtanen 3 But I am getting an output as follow: pekka peloton 0 jaana javanainen 0 liisa virtanen 1 I personally think this exercise testing is bugged. Or that the data contained within the csv files are not as expected. Here is my code: # write your solution here def get_student_matrix(filename: str): student_matrix = {} with open(filename) as new_file: for line in new_file: line_content = [word.strip() for word in line.split(";")] if line_content[0] != "id": student_matrix[line_content[0]] = f"{line_content[1]} {line_content[2]}" return student_matrix def get_exercise_matrix(filename: str): exercise_matrix = {} with open(filename) as new_file: for line in new_file: line_content = [word.strip() for word in line.split(";")] if line_content[0] != "id": exercise_matrix[line_content[0]] = sum([int(w) for w in line_content[1:]]) return exercise_matrix def get_exam_points_matrix(filename: str): exam_points_matrix = {} with open(filename) as new_file: for line in new_file: line_content = [word.strip() for word in line.split(";")] if line_content[0] != "id": exam_points_matrix[line_content[0]] = sum([int(w) for w in line_content[1:]]) return exam_points_matrix def grade(exer_nmbr: int, exm_pt: int) -> int: ex_pt = exer_nmbr // 10 if ex_pt >= 4: ex_pt = 10 points = ex_pt + exm_pt if points < 15: return 0 if 15 <= points <= 17: return 1 if 18 <= points <= 20: return 2 if 21 <= points <= 23: return 3 if 24 <= points <= 27: return 4 return 5 def main(): if False: # user input student_info = input("Student information: ") exercise_data = input("Exercises completed: ") exam_info = input("Exam points: ") else: # hard-coded input student_info = "students1.csv" exercise_data = "exercises1.csv" exam_info = "exam_points1.csv" students = get_student_matrix(student_info) exercises = get_exercise_matrix(exercise_data) exam_points = get_exam_points_matrix(exam_info) for student in students: if (student in exam_points) and (student in exercises): print(f"{students[student]} {grade(exercises[student], exam_points[student])}") main() I have tried debugging the VS Code - but I couldn't find any logical error in my code that would produce any error(s). Kindly help me find the flaws in my understanding. Since there are three csv files involved, I don't know how to upload them in this post, I am posting the contents of those files in succession. students1.csv id;first;last 12345678;pekka;peloton 12345687;jaana;javanainen 12345699;liisa;virtanen exercises1.csv id;e1;e2;e3;e4;e5;e6;e7 12345678;4;1;1;4;5;2;4 12345687;3;5;3;1;5;4;6 12345699;10;2;2;7;10;2;2 exam_points1.csv id;e1;e2;e3 12345678;4;1;4 12345687;3;5;3 12345699;10;2;2 N.B: I have also uploaded this on Submission 26968849 Continue reading...