Average score class
Write a function that receives a dictionary where each key is a student's name and the corresponding value is a list of grades for that student. The function should return the total average grade for the entire class.
class_a = {
'Alice': [85, 92, 78],
'Bob': [70, 88, 91],
'Charlie': [95, 91, 88],
'Alex': [50, 66, 54]
}
class_b = {
'David': [88, 77, 92],
'Eve': [90, 85, 79],
'Frank': [65, 72, 63],
'Grace': [80, 82, 87]
}
# define function "average_score" here ...
print(average_score(class_a)) # expected output: 79
print(average_score(class_b)) # expected output: 80
Python
Setting up Python environment...
Output