5. It's Okay to be Average


#1



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

I've looked at other forums and everything I read seems to agree with the code I have and I don't understand what the error message is trying to tell me, it says:

Oops, try again. average([3, 0]) returned function average at 0x7f44ff5ad938 instead of 1.5 as expected


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 average


#2

this line:

return average

why would you return the function? I would return the total (since that is what this function calculates)


#3

You're right that was a stupid mistake, I don't know why I couldn't figure that out. Thanks for the help.