input: Write a python function to list the factors of a given number.
  assert list_factors(24) == [1, 2, 3, 4, 6, 8, 12, 24]
  assert list_factors(15) == [1, 3, 5, 15]
  assert list_factors(7) == [1, 7]
output: def list_factors(n):
      factors = []
      for i in range(1, n + 1):
          if n % i == 0:
              factors.append(i)
      return factors