Next Index Previous

Python Examples

4. Program to find factorial of a number.

n = int(input('Enter a value'))
i=1
fact = 1

while i<=n:
	fact = fact*i
	i = i+1	

print('Factorial=',fact)	

Input :
5
Output :
120



Father of Python Language

Guido-van-Rossum

Guido van Rossum

Born: January 31, 1956, Netherlands