Next Index Previous

Python Examples

6. Program to find factors of a number.

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

while i<=n:
	if n%i==0:
		print(i)
	i = i+1	

Input :
24
Output :
1,2,3,4,6,8,12,24



Father of Python Language

Guido-van-Rossum

Guido van Rossum

Born: January 31, 1956, Netherlands