# Part of the Whole- feels correct still struck

**vivek20**#1

When you call the get_average function, the argument should be student (singular).

If you look at your for/in loop, you are calling this function get_average for each "student" in the list called "students".

Your `students`

list shouldn't be in the function like statement in the error explained to you.

I told you to take it out of the function, I'll let you figure out what you didn't do.

```
students = [lloyd, alice, tyler]
def get_class_average(students):
#rest of code should be the same
```

Here I took out the `students`

list you had from the function. That's because you can't use a list inside your function as part of an outside source. See what I mean?

**sagg95**#11

try this:

students=[lloyd,alice,tyler];

def get_class_average(students):

results=[];

for student in students:

results.append(get_average(student));

return average(results);

**stetim94**#14

your for loop:

`for student in student:`

why not:

`for student in students:`

students is a list holding your students, by looping over it, `student`

contains the students in turn (lloyd, alice, tyler) so then you can just append the average of student:

```
for student in students:
results.append(get_average(student))
```

then you put return at the same indent level as the for loop, so the whole loop can run. If you are still stuck after this, copy paste your whole code to the forum so we can actually run it.

**vivek20**#15

```
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)
total = total / len (numbers)
return total
def get_average(student):
homework = average(student['homework'])
quizzes = average(student['quizzes'])
tests = average(student['tests'])
return (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"
print get_letter_grade(get_average(lloyd))
students = [lloyd,alice,tyler]
def get_class_average(students):
results = []
for student in students:
results.append(get_average(student))
return average(results)
```

**stetim94**#16

you didn't change the indent of `return average(results)`

like i suggested, a function ends the moment a return keyword is reached, which is currently happening in the first run of the loop, place return outside the loop, so the whole loop can run