Factors of 12 are

Factors ( of a number ) are numbers which when divide the number they leave 0 as reminder

### Video Tutorial on Factors of a number

Here is the code to get factors of any number.

```
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=', ')
```

The number ( n ) is the factor of itself so we may print this number at the end to complete the list.

```
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 codesFibonacci series Prime Numbers Armstrong Number

This article is written by **plus2net.com** team.
https://www.plus2net.com

* indicates required

Post your comments , suggestion , error , requirements etc here

Python Video Tutorials

Python SQLite Video Tutorials

Python MySQL Video Tutorials

Python Tkinter Video Tutorials