Skip to content

Commit 52f5feb

Browse files
authored
Create facto.py
1 parent 94faec4 commit 52f5feb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

facto.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def factorial(n):
2+
if n == 0:
3+
return 1
4+
else:
5+
return n * factorial(n-1)
6+
n=int(input("Input a number to compute the factiorial : "))
7+
print(factorial(n))

0 commit comments

Comments
 (0)