8000 Create Factorial By Recursion Python.py · dingcx/pythonAlgorithms@3df093a · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 3df093a

Browse files
AryashDubeyabranhe
authored andcommitted
Create Factorial By Recursion Python.py
1 parent 5536881 commit 3df093a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#FINDING FACTORIAL THROUGH RECURSION
2+
def recursion(n):
3+
if(n==0):
4+
return 1
5+
else:
6+
return n*recursion(n-1)
7+
a=int(input("Enter The Number You Want The Factorial Of")) #Asking User The Number for the factorial
8+
if(a>=0): # Checking if the Number is positive or not
9+
print(recursion())
10+
else:
11+
print("Enter Valid Positive Number")

0 commit comments

Comments
 (0)
0