Just weight and see


#1



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


#2

for your tests, you forgot to calculate the average


#3

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


#4

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

<function get_average at 0x7fb233ae7140>

#5

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


#6

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


#7

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


#8

no thats what it outputs in the console


#9

yes, because you forgot the parentheses


#10

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


#11

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)


#12

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


#13

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