This assignment is about creating subroutines that compute simple statistics on numeric lists, and testing them in a separate program. In the file as-174-3.zip, you can find 2 files: ListStats.py and ListStatTests.py.
Your task is to complete the implementation the following functions in ListStats.py:
Average(sample)
Average( [a1, ..., an] ) returns the average value of the given list of numeric values.
Median(sample)
Median( [a1, ..., an] ) returns the median value of the given list of numeric values; the median is the numeric value m that has the property that half of the values in sample are smaller than m, and half of the values in sample are larger than m.
Variance(sample)
Variance( [a1, ..., an] ) returns the sample variance of the given list of numeric values; the variance is the mean of the squared differences between the values and the mean of the list of values.
|