tests are done

This commit is contained in:
2024-03-31 22:13:18 +03:00
parent e1449cb649
commit 830e0a0791
5 changed files with 15 additions and 12 deletions
+11 -9
View File
@@ -1,11 +1,13 @@
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
ans = 1
if x < 0:
raise ValueError('x must be greater than 0')
for i in range(1, x+1):
ans *= i
return ans