Skip to content

Commit ea81376

Browse files
committed
Create factorial.py
test
1 parent 404d43e commit ea81376

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

factorial.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def fact(x):
2+
if x == 0:
3+
return 1
4+
return x * fact(x - 1)
5+
6+
x=int(input())
7+
print(fact(x))

0 commit comments

Comments
 (0)