Write a program in python to **find and print all the factors of a number**.

**Example:**

1 2 | Input: 15 Output: [1, 3, 5] |

To find factors of any number in python we need to follow the following steps.

- Input a number (
`num`

) - Loop from 1 to
`num`

and check if`num`

is divisible by them or not. - If yes then that number is the fator of
`num`

.

*Recommended: Python For Loop*

1 2 3 4 5 6 7 8 9 10 | num = int(input("Enter a number: ")) #empty list for storing factors factors = [] for i in range(1,num): if num%i == 0: factors.append(i) print(factors) |

**Output**

1 2 | Enter a number: 15 [1, 3, 5] |

If you are having trouble understanding the code then please comment below your doubts.