You are given results, a list of tuples. Each tuple has the form (student, course, score) where student is a str, course is a str and score is an int. You are also given cutoff (int).
For each course, a student passes when their score is greater than or equal to cutoff. Return a dictionary that maps each course to its pass rate: the number of passing scores divided by the total number of scores for that course, rounded to 2 decimal places using round.
If results is empty, return an empty dictionary.
NOTE: This is a function-type question — you only write the function. Do not read input or print anything; a hidden checker calls your function and checks its return value.
Arguments
[('s1', 'math', 80), ('s2', 'math', 40), ('s3', 'cs', 90)]
50
Returns
{'math': 0.5, 'cs': 1.0}