Here\'s my code:
def factorize(n): sieve = [True] * (n + 1) for x in range(2, int(len(sieve) ** 0.5) + 1): if sieve[x]: for i i
My one-liner with python 3.8 (assignment expressions used)
f = lambda n: (p:=[next(i for i in range(2, n+1) if n % i == 0)] if n>1 else [])+(f(n//p[0]) if p else [])
video with details - Factorizing number in Python