Just weight and see


Oops, try again. get_average(alice) raised the following error: can't multiply sequence by non-int of type 'float'

I used the parenthesis instead of the continuation slash because it kept saying a syntax error after all my code

def get_average(student):
    homework = average(student["homework"])
    quizzes = average(student["quizzes"])
    tests = average(student["tests"])
    return (.10 * average(student["homework"])) + (.30 * average(student["quizzes"])) + (.60 * (student["tests"]))
print get_average


for your tests, you forgot to calculate the average


ignoring for a second that you do the math twice (first you do the math, store this in variables), then at return you do the same math, again


it passed it through but my output for print comes back as

<function get_average at 0x7fb233ae7140>


that is because function calls require parentheses, between the parentheses supply arguments if needs be


so if i print just print student it should print the averages?


i was referring to your get_average function call which is missing its parentheses


no thats what it outputs in the console


yes, because you forgot the parentheses


i tried print (get_average) printed the same output
i tried print get_average() got an error message
tried print get_average(student) and got another error message
like i said it let me pass the lesson but i still want it to print the output correctly


this is pretty close:

print get_average(student)

but you should actually pass one of your students (alice, tyler or lloyd) as argument. The argument get copied into the function parameter (student)


oh ok thats a little more helpful i figured i was just overthinking it all happens pretty often


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.