input: from typing import List
  
  
  def prime_factors(n: int) -> List[int]:
      """ Generate a list of prime factors for the given integer, ordered from smallest to largest.
      Each prime factor should appear as many times as it divides the input number.
      The input integer should be equal to 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
  