for the code below, it shows get_average(alice) raised the following error: string indices must be integers, not str

def get_average(students):

for student in students:

homework = average(student[“homework”])

quizzes = average(student[“quizzes”])

tests = average(student[“tests”])

return 0.1 * homework + 0.3 * quizzes + 0.6 * tests

while the correct code still have str in get_average, why is that

def get_average(student):

homework = average(student[“homework”])

quizzes = average(student[“quizzes”])

tests = average(student[“tests”])

total = homework *.1 + quizzes * .3 + tests * .6

return total