input: from typing import List
  
  def prime_factors(n: int) -> List[int]:
      """ Generate a list of prime factors for a given integer in ascending order.
      Each factor appears in the list as many times as it divides the integer.
      The input number should be the product of all returned factors.
      >>> prime_factors(8)
      [2, 2, 2]
      >>> prime_factors(25)
      [5, 5]
      >>> prime_factors(70)
      [2, 5, 7]
      """
output:     
      factors = []
      divisor = 2
      while n >= 2:
          while n % divisor == 0:
              factors.append(divisor)
              n //= divisor
          divisor += 1
      return factors
  