To understand why we use `students`

, you must first understand why we use parameters.

As of defining the function, the program does not know whether `students`

is a number, a string, a list, a dictionary, etc. As far as the program is concerned `students`

could be anything. And the the program could care less. It's just a placeholder for whatever you pass into the function when you actually call it. In other words think of parameters like variables, whenever you call a function, the argument you pass into it becomes the value for `students`

. For instance if you called:

`get_class_average([lloyd, alice, tyler])`

You would essentially be telling the program to run get_class_average(students) except now, `students = [lloyd, alice, tyler]`

. Until a function is actually called, the parameters you have set are valueless placeholders. Once you call the function and pass in arguments for those parameters, they take on value and purpose. What I mean by this is, if you did the following:

```
lloyd = {
"name": "Lloyd",
"homework": [90.0, 97.0, 75.0, 92.0],
"quizzes": [88.0, 40.0, 94.0],
"tests": [75.0, 90.0]
}
alice = {
"name": "Alice",
"homework": [100.0, 92.0, 98.0, 100.0],
"quizzes": [82.0, 83.0, 91.0],
"tests": [89.0, 97.0]
}
tyler = {
"name": "Tyler",
"homework": [0.0, 87.0, 75.0, 22.0],
"quizzes": [0.0, 75.0, 78.0],
"tests": [100.0, 100.0]
}
# Add your function below!
def average(numbers):
total = sum(numbers)
total = float(total)
return total/len(numbers)
def get_average(student):
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])
return float((homework * 0.1) + (quizzes * 0.3) + (tests * 0.6))
def get_letter_grade(score):
if score >= 90:
return "A"
elif score >= 80:
return "B"
elif score >= 70:
return "C"
elif score >= 60:
return "D"
else:
return "F"
def get_class_average(students):
results = []
for student in students:
results.append(get_average(student))
return average(results)
get_class_average([lloyd, alice, tyler])
```

Notice how I defined the function using `students`

as a parameter and then I called the function using a list of all the students as an argument. This is telling the program to run the code within `get_class_average(students)`

but replace all mentions of `students`

with that list. Basically it does this:

```
results = []
for student in [lloyd, alice, tyler]:
results.append(get_average(student))
return average(results)
```

This is why we use `students`

as we do in the function. As for why we use `student`

, well...

Just like with `students`

, as of defining the function, the program does not know whether `student`

is a number, a string, a list, a dictionary, etc. As far as the program is concerned `student`

could be anything. And the the program could care less. It's just a placeholder for whatever you pass into the function when you actually call it. In other words think of parameters like variables, whenever you call a function, the argument you pass into it becomes the value for `student`

. For instance if you called:

`get_average(lloyd)`

You would essentially be telling the program to run `get_average(student)`

except now, `student = lloyd`

. Until a function is actually called, the parameters you have set are valueless placeholders. Once you call the function and pass in arguments for those parameters, they take on value and purpose. What I mean by this is, if you did the following:

```
lloyd = {
"name": "Lloyd",
"homework": [90.0, 97.0, 75.0, 92.0],
"quizzes": [88.0, 40.0, 94.0],
"tests": [75.0, 90.0]
}
alice = {
"name": "Alice",
"homework": [100.0, 92.0, 98.0, 100.0],
"quizzes": [82.0, 83.0, 91.0],
"tests": [89.0, 97.0]
}
tyler = {
"name": "Tyler",
"homework": [0.0, 87.0, 75.0, 22.0],
"quizzes": [0.0, 75.0, 78.0],
"tests": [100.0, 100.0]
}
# Add your function below!
def average(numbers):
total = sum(numbers)
total = float(total)
return total/len(numbers)
def get_average(student):
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])
return float((homework * 0.1) + (quizzes * 0.3) + (tests * 0.6))
get_average(lloyd)
```

Notice how I defined the function using `student`

as a parameter and then I called the function using `lloyd`

as an argument. This is telling the program to run the code within `get_average(student)`

but replace all mentions of `student`

with lloyd. Basically it does this:

```
homework = average(lloyd["homework"])
quizzes = average(lloyd["quizzes"])
tests = average(lloyd["tests"])
return float((homework * 0.1) + (quizzes * 0.3) + (tests * 0.6))
```

`lloyd["homework"]`

is an identifier for the value of `"homework"`

in the dictionary called `lloyd`

.

`lloyd["quizzes"]`

is an identifier for the value of `"quizzes"`

in the dictionary called `lloyd`

.

`lloyd["tests"]`

is an identifier for the value of `"tests"`

in the dictionary called `lloyd`

.

This is why we use `student`

as we do in the function.