<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

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

<In what way does your code behave incorrectly? Include ALL error messages.>

I’m not getting an error code from the window, but instead Codecademy is saying “Oops, try again. Make sure you converted the total or the length to a float before the division - average([3, 0]) returned 1.0 instead of 1.5 as expected.”

As far as I can tell I did convert the total to a float before the division, so I don’t understand why I’m having this issue. Is there something wrong in my code (below)?

<What do you expect to happen instead?>

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)

result = total % len(numbers)

return result

Here are the instructions:

Write a function average that takes a list of numbers and returns the average.

Define a function called average that has one argument, numbers.

Inside that function, call the built-in sum() function with the numbers list as a parameter. Store the result in a variable called total.

Like the example above, use float() to convert total and store the result in total.

Divide total by the length of the numbers list. Use the built-in len() function to calculate that.

Return that result.

`<do not remove the three backticks above>`