Пример #1
0
 def test_median_is_last(self):
     self.assertNotEqual(1, median(3, 1, 2))
Пример #2
0
#################################################################################
#########################   LET USER TEST FUNCTIONS    ##########################
#################################################################################
#################################################################################
choice = ''

print('Select operation!')
print('1.Median')
print('2.Standard Deviation')
print('3.Calculate Z-Score for each Number')
print('4.Calculate Population Variance')

choice = input('Enter choice:')

if choice == "1":
    from Median import median
    print('median: ', str(median(dataSet)))
elif choice == "2":
    from StandardDeviation import standardDeviation
    print('standard deviation: ', str(standardDeviation(dataSet)))
elif choice == "3":
    from zScore import zScore
    print('z-score: ', str(zScore(dataSet)))
elif choice == "4":
    from Variance import variance
    print('variance: ', str(variance(dataSet)))
else:
    print(
        "(•̀ᴗ•́ )(•̀ᴗ•́ )(•̀ᴗ•́ ) something went wrong (•̀ᴗ•́ )(•̀ᴗ•́ )(•̀ᴗ•́ )"
    )
Пример #3
0
 def test_median_is_first(self):
     self.assertEqual(2, median(2, 1, 3))
Пример #4
0
 def test_median_is_middle(self):
     self.assertEqual(1, median(1, 2, 3))
Пример #5
0
 def test_median_is_last(self):
     self.assertNotEqual(1, median(3, 1, 2))
Пример #6
0
 def test_median_is_first(self):
     self.assertEqual(2, median(2, 1, 3))
Пример #7
0
 def test_median_is_middle(self):
     self.assertEqual(1, median(1, 2, 3))