Init repo mat_lib

This commit is contained in:
Daniil Doroshenko
2024-04-05 11:30:03 +00:00
commit 617dd1e10f
4 changed files with 26 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
def factorial(x):
    ans = 1
    if x < 0:
        raise ValueError('x must be greater than 0')
    for i in range(1, x+1):
        ans *= i
    
    return ans