Python Program to Find the Factors of a Number

Python Program to Find the Factors of a Number: In this program, we will learn about python program to find the factor of a number.

Python Program to Find the Factors of a Number

Source Code

# Python Program to find the factors of a number

# This function computes the factor of the argument passed
def print_factors(x):
   print("The factors of",x,"are:")
   for i in range(1, x + 1):
       if x % i == 0:
           print(i)

num = 320

print_factors(num)

Output of Program