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


#1



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


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


the average equals 97.5
None


def average(numbers):
    total = float(sum(numbers))
    average = total/len(numbers)
    print "the average equals",(average)
    return;
    
average(alice["homework"])


#2

That line is not asked for in the instructions. We are also told to use only the variable, total.

The error message indicates that no return value has been sent back. Remember to return total.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.