id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

chanr@sfusd.edu > average
prev  |  next  |  chance

Write an average() function that has a numbers parameter. This function returns the statistical average of the list of integer numbers passed to the function. Avoid using Python's built-in sum().
Passing an empty list to average() should cause it to return None.


average([1, 2, 3]) → 2
average([1, 2, 3, 1, 2, 3, 1, 2, 3]) → 2
average([12, 20, 37]) → 23

...Save, Compile, Run (ctrl-enter)

def average(numbers):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 201 Post-solution available

Copyright Nick Parlante 2017 - privacy