mirror of
https://github.com/ada-dmitry/python_ada.git
synced 2026-09-25 18:00:26 +00:00
added many files
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import unittest
|
||||
|
||||
def fact(x):
|
||||
if(x==1):
|
||||
return 1
|
||||
else:
|
||||
return x*fact(x-1)
|
||||
|
||||
class FactTest(unittest.TestCase):
|
||||
'''Проверка функции факториала'''
|
||||
|
||||
def test_5_fact(self):
|
||||
ans = fact(5)
|
||||
self.assertEqual(ans, 120)
|
||||
|
||||
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user