Factorial Program in Python: Python Program to Find Factorial of a Number
Simple python program to find the factorial of a number.
A factorial of a number is the product of number less than or equal to n.
Factorial Program in Python: In this post you will learn a Python program
to find factorial of a number.
Output
What is Factorial of a Number?
- Factorial of a number is the product of all whole number less that or equal to n.
- Factorial of a number is denoted by n!.\
- For example factorial of 4 is denoted by 4! which is equal to 4✕3✕2✕1 = 24.
- Always remember factorial of 0! is 1.
Factorial Program in Python
Write a Program in Python to Find Factorial of a Number:
Program
c = 1
n = int(input("Enter the Number\n"))
for i in range(1, n+1):
c = c*i
print("Factorial of", n, "is", c)
Enter the Number
5
Factorial of 5 is 120
The above program is a Factorial program in python using For loop.