A school records test results: the class, the subject and the score. The head wants a grid of average scores, one row per class and one column per subject.
Some classes haven't sat a test in some subjects yet. Writing 0 in those boxes would look like the class scored zero, which is wrong. Those boxes must stay empty.
Task: write score_grid(classes, subjects, scores). Result i is class classes[i] scoring scores[i] in subjects[i].
Return a dictionary with two keys:
"subjects": every subject that appears, sorted alphabetically."rows": one list per class, sorted alphabetically by class. Each list is the class name followed by its average score in each subject, in the same order as "subjects".Each average is a float rounded to 1 decimal place. A box with no results is None. There is at least one result.