Write a python function that prints the factors of a given number


Topic: Write a python function that prints the factors of a given number

Solution

def print_factors(x):
   print(f"The factors of {x} are:")
   for i in range(1, x + 1):
       if x % i == 0:
           print(i)



List all Python Programs