After execute test.py

This commit is contained in:
Daniil Doroshenko
2024-04-05 12:20:22 +00:00
parent 617dd1e10f
commit 112380e2a8
5 changed files with 12 additions and 13 deletions
Regular → Executable
+7 -10
View File
@@ -1,11 +1,8 @@
#!/usr/bin/python3
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