input: def generate_factors(x):
      """ This function takes a number and returns its factors as a list.
  
      :param x: The number whose factors are to be found.
      :return: A list of factors of the number x.
      >>> generate_factors(6)
      [1, 2, 3, 6]
      >>> generate_factors(15)
      [1, 3, 5, 15]
      """
      factors = []
      for i in range(1, x + 1):
          if x % i == 0:
              factors.append(i)
      return factors
output:     factors = []
      for i in range(1, x + 1):
          if x % i == 0:
              factors.append(i)
      return factors