I am trying to implement a function primeFac() that takes as input a positive integer n and returns a list containing all the numbers in the prime
primeFac()
n
Simple way to get the desired solution
def Factor(n): d = 2 factors = [] while n >= d*d: if n % d == 0: n//=d # print(d,end = " ") factors.append(d) else: d = d+1 if n>1: # print(int(n)) factors.append(n) return factors