I want to compute the overall grade of each student. Add the overall grade in a new dictionary called midterm_grades, with the students as keys, and the overall grades as (integer) values.
grades = {
"studentA" : [5, 2, 3, 1, 2, 4, 5, 5, 1, 1],
"studentB" : [1, 2, 5, 5, 2, 0, 1, 5, 5, 2],
"studentC" : [2, 5, 5, 5, 5, 0, 1, 3, 1, 0],
"studentD" : [0, 1, 0, 5, 2, 5, 1, 3, 3, 5],
"studentE" : [5, 4, 5, 5, 1, 5, 1, 4, 4, 5],
"studentF" : [2, 2, 1, 1, 1, 3, 1, 3, 0, 1],
"studentG" : [5, 5, 5, 5, 5, 4, 3, 5, 3, 1],
}
dct_sum = {k: sum(v.values()) for k, v in grades.items()}
However, Python throw a error message: AttributeError: 'list' object has no attribute 'values'