Пример #1
0
 def test_factorial_of_1(self):
   self.assertEqual(1, factorial(1))
Пример #2
0
 def test_factorial_of_5(self):
   self.assertEqual(120, factorial(5))
Пример #3
0
 def test_factorial_of_2(self):
   self.assertEqual(2, factorial(2))
Пример #4
0
 def test_factorial_of_3(self):
   self.assertEqual(6, factorial(3))
Пример #5
0
#!/usr/bin/python

import sys

from library import factorial

number = int(sys.argv[1])
factorial = factorial(number)

print('{0}! = {1}'.format(number, factorial))