Python Program to Find All the Divisors of an Integer

bookmark

n=int(input("Enter an integer:"))
print("The divisors of the number are:")
for i in range(1,n+1):
    if(n%i==0):
        print(i)

 

Output

Enter an integer:25
The divisors of the number are:
1
5
25