Just weight and see


#1

Hey guys please help me out am stuck at #Just weight and see
Am getting an error message ......."Oops, try again. get_average(alice) raised the following error: 'float' object is not iterable...."

Here's my code,
def get_average(student) :
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])

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

return sum(weight)

where's the problem?


#2

here:

return sum(weight)

why use sum()? weight already contains the weighted average


#3

Oooh...silly me :slight_smile:
Thank You...it worked


#4