The following is the program.
Explanation:
def print_factors(y):
print("The factors of",y,"are:")
for j in range(1, y + 1):
if y % j == 0:
print(j)
num = 320
print_factors(num)
The above program calculates the factors of n. Here def is called as define function. We are calculating the factors of y. After that, we are giving them for the condition. If the condition is true it will print the factors of y.