title: Factorizing a number in Python
body: <p>Here's my code:</p>
  <pre><code>def factorize(n):
      sieve = [True] * (n + 1)
  
      for x in range(2, int(len(sieve) ** 0.5) + 1):
          if sieve[x]: 
              for i in range(x + x, len(sieve), x):
                  sieve[i] = False
  
      lowerPrimes = i for i in range(2, len(sieve)) if sieve[i]] and (n % i == 0)]
      return lowerPrimes
  </code></pre>
  <p><code>factorize(n)</code> returns all prime factors of the given value <code>n</code>. As you can see, it first makes an Eratosthenes sieve for <code>n</code> and then uses a list comprehension to return all values in the sieve that are factors of <code>n</code>. It works relatively fine for this purpose, however, I want it to return a list so that if you multiply every item in it, the result is <code>n</code>. Do you get my point?</p>
  <p>For example, <code>factorize(99020)</code> returns <code>[2, 5, 4951]</code>, but I'd like it to return <code>[2, 2, 5, 4951]</code>, as <code>2*2*5*4951 = 99020</code>.</p>
  <p>I know my approach is not even close, but could you help me to make it so?</p>