Skip to content

Commit 3b41c13

Browse files
Hack to ber
1 parent 960872f commit 3b41c13

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Python2.0

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
def factorial(x):
2+
3+
"""This is a recursive function
4+
5+
to find the factorial of an integer"""
6+
7+
if x == 1:
8+
9+
return 1
10+
11+
else:
12+
13+
return (x * factorial(x-1))
14+
15+
num = 3
16+
17+
print("The factorial of", num, "is", factorial(num))

0 commit comments

Comments
 (0)