103 - Factorize an Integer

103 - Factorize an Integer#

Write a function to factorize a number into primes and return the list of primes from the function. Print them out.

In your first implementation, just brute force a solution. Do not attempt to look up solutions or algorithms online or anything outside the course material. Then if you have time think a bit harder and try to come up with more elegant solutions.

def factorize(i):
    # ....
    return factors

factors = factorize(12)
print(factors)
[2, 2, 3]