# Why does get_average(students) call to average(numbers)?

#1

Link to excercise: Just Weight and See

Hi all, I have done this exercise correctly but... I don't know why this works. Particularly, I want to know how this `get_average(students)` function calls to the original `average(numbers)` function when the `get_average(students)` function doesn't have the argument `(numbers)`. I passed the excercise and even printed out `print get_average(lloyd)` to see the interpreted result and it works. But, why?

Intuitively, I put `homework = average(numbers["homework"]) * 0.1` thinking it would properly call the first function but it doesn't. Can someone clear this misunderstanding up for me?
Thanks!

``````def average(numbers):
total = sum(numbers)
total = float(total)
total /= len(numbers)

def get_average(students):

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

#2

Hi that functon

``````def average(numbers):
total = sum(numbers)
total = float(total)
total /= len(numbers)

make t average of any list of number ... and this function

``````def get_average(students):
homework = average(students["homework"]) * 0.1
quizzes = average(students["quizzes"]) * 0.3
tests = average(students["tests"]) * 0.6
return homework + quizzes + tests
print get_average(lloyd)``````

will make the average of your student then this line

``homework = average(students["homework"]) * 0.1``

why it isn't homework = average(numbers["homework"]) * 0.1 ?
we put students because it's the argument of the function get_average() ...like you say you called the functon with lloyd like that get_average(lloyd) in the function it will look like that

``homework = average(lloyd["homework"]) * 0.1``

where you put the argument students when you call the functiont will take that place