- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Find Factorial of Number Using Recursion in Python?
Factorial of a number is product of all numbers from 1 to that number.
A function is called a recursive function if it calls itself.
In following program factorial() function accepts one argument and keeps calling itself by reducing value by one till it reaches 1.
def factorial(x): if x==1: return 1 else: return x*factorial(x-1) f=factorial(5) print ("factorial of 5 is ",f)
The result is
factorial of 5 is 120
- C++ Program to Find Factorial of a Number using Recursion
- Java Program to Find Factorial of a Number Using Recursion
- Python Program to find the factorial of a number without recursion
- Java program to find the factorial of a given number using recursion
- C++ program to Calculate Factorial of a Number Using Recursion
- How to Find the Factorial of a Number using Python?
- Write a Golang program to find the factorial of a given number (Using Recursion)
- How to Find the Power of a Number Using Recursion in Python?
- Factorial program in Java using recursion.
- Factorial program in Java without using recursion.
- Python program to find factorial of a large number
- C++ Program to Find Factorial of a Number using Iteration
- Find power of a number using recursion in C#
- How to Find Sum of Natural Numbers Using Recursion in Python?