input: Write a python function to find all factors of a given number.
  assert all_factors(6) == [1, 2, 3, 6]
  assert all_factors(12) == [1, 2, 3, 4, 6, 12]
  assert all_factors(17) == [1, 17]
output: def all_factors(n):
      factors = []
      for i in range(1, n + 1):
          if n % i == 0:
              factors.append(i)
      return factors