homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])
weight_sum = (homework * .1) + (quizzes * .3) + (tests * .6)
if score >= 90:
elif score >= 80:
elif score >= 70:
elif score >= 60:
results = 
for student in students:
grades = get_average(student)
Traceback (most recent call last):
File "python", line 53, in
File "python", line 49, in get_class_average
File "python", line 28, in get_average
TypeError: list indices must be integers, not str
Highlighted code represents the lines in the error message.
Not sure why this error is coming up since the string is for the key and presumably the call should be for the associated value (e.g. an integer).
Nonetheless assistance would be appreciated.