Just Weight and See


#1



https://www.codecademy.com/en/courses/python-beginner-en-qzsCL/1/2?curriculum_id=4f89dab3d788890003000096


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.


#2

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


#3

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