Just Weight and See



No error message , i just don't get how the input of the below function works , i mean how does the average function get the name of the student ?

i see no variable called " student" in our code

please explain

    homework = average(student["homework"])
    quizzes = average(student["quizzes"])
    tests = average(student["tests"])

Replace this line with your code.


student is the function parameter:

def get_average(student):

then, when you call the function, you specify the student:

print get_average(lloyd)

now lloyd (argument at function call) gets copied into the function parameter

the function parameter (student) serves as a placeholder till you supply argument at function call

If you need more syntax refreshers about function, i recommend revisiting the function track


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