n=25 # change this value
for i in range (1,n+1):
if(n%i==0):
print(i,end=', ')
Output
1, 5, 25,
Modulus is the reminder of a division. Here n%i returns 0 if reminder of division is zero. For all the numbers where reminder is 0 we are printing by using if condition checking.
n=int(input("Enter a number : "))
#n=25
for i in range (1,n+1):
if(n%i==0):
print(i,end=', ')
n=125
for i in range (1,int(n/2)+1):
if(n%i==0):
print(i,end=', ')
print(n)
Output
1, 5, 25, 125
All Sample codes 
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.