Skip to content

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy