The code is correct. I have verified it by hand calculation. Yet I get the error "Oops, try again. get_class_average([alice]) returned 83.8666666667 instead of 91.15 as expected "

Why is the page calling the function with a student "alice"? Since this is a class average, the get_class_average function should be called with the list "students" (as per the instruction this is the name of list with all 3 students). If the get_class_average function is called with the student list, it will work properly.

FYI...there seems to be an error in the instructions. it states "For each student item in the class list". I think name of the list cannot be 'class'

```
lloyd = {
"name": "Lloyd",
"homework": [90.0, 97.0, 75.0, 92.0],
"quizzes": [88.0, 40.0, 94.0],
"tests": [75.0, 90.0]
}
alice = {
"name": "Alice",
"homework": [100.0, 92.0, 98.0, 100.0],
"quizzes": [82.0, 83.0, 91.0],
"tests": [89.0, 97.0]
}
tyler = {
"name": "Tyler",
"homework": [0.0, 87.0, 75.0, 22.0],
"quizzes": [0.0, 75.0, 78.0],
"tests": [100.0, 100.0]
}
students=[lloyd,alice,tyler]
# Add your function below!
def get_average(student):
h_total=sum(student["homework"])
homework=float(h_total)/len(student["homework"])
q_total=sum(student["quizzes"])
quiz=float(q_total)/len(student["quizzes"])
t_total=sum(student["tests"])
test=float(t_total)/len(student["tests"])
w_h=homework*0.1
w_q=quiz*0.3
w_t=test*0.6
score=w_h+w_q+w_t
return score
print get_average(lloyd)
print get_average(alice)
print get_average(tyler)
def get_letter_grade(score):
if score >=90:
return "A"
elif score >=80:
return "B"
elif score >=70:
return "C"
elif score >=60:
return "D"
else:
return "F"
def get_class_average(s):
results=[]
for c in students:
get_average(c)
results.append(get_average(c))
avg_result=sum(results)/len(results)
return avg_result
get_class_average(students)
print get_class_average(students)
```