예제 #1
0
 def test_factorial(self):
     self.assertEqual(factorial_iter(0), 1)
     self.assertEqual(factorial_iter(1), 1)
     self.assertEqual(factorial_iter(3), 6)
     self.assertEqual(factorial_rec(0), 1)
     self.assertEqual(factorial_rec(1), 1)
     self.assertEqual(factorial_rec(3), 6)
예제 #2
0
 def test_factorial(self):
     self.assertEqual(factorial_iter(3), 6)
     self.assertEqual(factorial_iter(3), factorial_rec(3))
     self.assertEqual(factorial_iter(20), factorial_rec(20))
     self.assertEqual(factorial_rec(4), 24)
예제 #3
0
 def test_factorial(self):
     self.assertEqual(factorial_iter(3), 6)
     self.assertEqual(factorial_iter(3), factorial_rec(3))
     self.assertEqual(factorial_iter(1), factorial_rec(0))
     self.assertEqual(factorial_iter(9), factorial_rec(9))