Ex. 6: Just Weight and See

Everything is printed as expected, but for some reason, no matter the changes, it raises the following error:

'Oops, try again. get_average(alice) raised the following error: 0 '

The code seems to be ok, really don't know why it keeps on bringing that up and doesn't let me continue. Would really appreciate it if you could help me with this!

```
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]
}
students = [lloyd, alice, tyler]
def average(numbers):
sum = 0
for number in numbers:
sum += number
sum = float(sum)
avg = sum/(len(numbers))
return avg
def get_average(student):
for i in range (0,len(student)):
homework = average(student[i]['homework'])
quizzes = average(student[i]['quizzes'])
tests = average (student[i]['tests'])
wtotal = [homework, quizzes, tests]
wavg = 0.1 * wtotal[0] + 0.3 * wtotal[1] + 0.6 * wtotal[2]
print student[i]['name']
print "Homework average = ", homework
print "Quizzes Average = ", quizzes
print "Tests Average = ", tests
#print "Total Average = ", average(total)
print "Weighted Average = ", wavg
print "\n"
get_average(students)
```