We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9451b9b commit 866e7efCopy full SHA for 866e7ef
Patterns/factorial_calculation.py
@@ -0,0 +1,8 @@
1
+# recursively finds the factorial of a number
2
+def factorial(number):
3
+ if number == 0:
4
+ return 1
5
+ else:
6
+ return factorial(number - 1) * number
7
+
8
+print(factorial(20))
0 commit comments