Hi, I get the answer but without the use of methods in the instructions. May I know who has solved the problem? My code is :

for s in students :

homework = average (s["homework"])

quizzes = average (s["quizzes"])

tests = average (s["tests"])

weighted_average = 0.1*homework + 0.3*quizzes + 0.6*tests

print weighted_average

students = [lloyd, alice, tyler]

I tried using the instructions but I just cannot get the answer.

I have tried to use function as instructed. This is my answer :

def get_average(student):

for s in student :

homework= average (s["homework"])

quizzes= average (s["quizzes"])

tests= average (s["tests"])

weighted_average = 0.1 *(homework) + 0.3 *(quizzes) + 0.6 * (tests)

return weighted_average

student = [lloyd, alice, tyler]

I get the error : get_average(alice) raised the following error: string indices must be integers, not str

Does coding really takes so much time to get the correct answer? I have used a few hours but to no avail.