Esempio n. 1
0
import stats

my_list = [4,1,5,7,6,8,9,10,8,3,3,8,12]


mean  = stats.mean(my_list)
print('The mean is: ' +  str(mean))

median = stats.median(my_list)
print('The median is: ' +  str(median))

range = stats.range(my_list)
print('The range is: ' +  str(range))

sum = stats.sum(my_list)
print('The sum of all numbers is: ' + str(su
Esempio n. 2
0
 def testSingleRange(self):
     # passing only one data point must return zero
     self.assertEqual(stats.range([5]), 0)
Esempio n. 3
0
 def testNoRange(self):
         # passing two equal data points must return zero
     self.assertEqual(stats.range([5.3,5.3]), 0.0)
Esempio n. 4
0
 def testNoRange(self):
     # passing two equal data points must return zero
     self.assertEqual(stats.range([5.3, 5.3]), 0.0)
Esempio n. 5
0
 def testSingleRange(self):
         # passing only one data point must return zero
     self.assertEqual(stats.range([5]), 0)