Just Weight and See......Error


#1

This is ther error: Oops, try again. get_average(alice) raised the following error: 'function' object has no attribute 'getitem'

This is the code:

def get_average(student):
homework = average["homework"]
quizzes = average["qiuzzes"]
tests = average["tests"]

return 0.1 * average(student["homework"]) + \
0.3 * average(student["bananas"]) +  0.6 * \
average(student["tests"])

#2

this:

return 0.1 * average(student["homework"]) + \
0.3 * average(student["bananas"]) +  0.6 * \
average(student["tests"])

is the correct solution, but you get an error here:

homework = average["homework"]
quizzes = average["qiuzzes"]
tests = average["tests"]

because average is a function, no a dictionary


#3

Corrected:

def get_average(student):
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])

return 0.1 * average(student["homework"]) + \
0.3 * average(student["bananas"]) +  0.6 * \
average(student["tests"])

But, I get another error:

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


#4

apart from doing things a bit double, and that you use bananas here:

0.3 * average(student["bananas"])

which should be quizzes, it looks good


#5

Got it, thank you so much


#6