List turns to "None", trying to make a factorizing program : <p>I am trying to make a program that factorized numbers. I made a definition for making prime numbers, it worked fine, but when I try the factorization it doesn't work. I think the prime list turns to None. Here's the code:</p>

<pre><code>def prime_num(ulist):
    list_primes = sorted(ulist)
    num = list_primes[-1]
    i = 0
    while i &lt; 1:
        num += 1
        count = 0
        while i &lt; 1:
            prime = True
            if count &gt;= len(list_primes):
                count -= 1
                break
            if num/list_primes[count] == int(num/list_primes[count]):
                prime = False
                break
            count += 1
        if prime:
            return num


def factorize(num):
    prime_list = [2, 3]
    factors_list = []
    i = 0
    while i &lt;= round(num/2):
        if int(num/prime_list[i]) == num/prime_list[i]:
            i = 0
            factors_list = factors_list.append(prime_list[i])
            num /= prime_list[i]
        random_list = prime_list.append(prime_num(prime_list))
        prime_list = random_list
        i += 1
        print(factors_list)


factorize(6)
</code></pre>
