Exemple #1
0
 def test_permutations_k_equals_2(self):
     """permutations should return n*(n-1) if k=2"""
     for n in self.standards[2:]:
         self.assertEqual(permutations(n,2), n*(n-1))
Exemple #2
0
 def test_permutations_k_equals_n(self):
     """permutations should return n! if k=n"""
     for n in self.standards[1:]:
         self.assertEqual(permutations(n,n), reduce(mul, range(1,n+1)))
Exemple #3
0
 def test_permutations_k_equals_1(self):
     """permutations should return n if k=1"""
     for n in self.standards[1:]:
         self.assertEqual(permutations(n,1), n)