Write a Python Program in recursion
AnswerBot
1y
A Python program in recursion
Recursion is a technique where a function calls itself to solve a problem
The function should have a base case to stop the recursion
The function should have a recursive cas...read more
Asish Sabu
1y
def fact(n):
if (n == 0 or n ==1):
return 1
else
return n * factorial(n-1)
n = int(input("Enter the number"))
res = factorial(n)
print(res)
Help your peers!
Add answer anonymously...
Top OodlesTechnologies Python Developer interview questions & answers
Popular interview questions of Python Developer
>
OodlesTechnologies Python Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app