def factors(n): list = [] for x in range(2, n+1): while n % x == 0: list.append(x) n = n//x if n == 1: return listI produced some code to give me a list of prime factors of any number. But when I execute the code it produces this:
factors(10075)
Out[99]: [5, 5, 13, 31]
It pastes two of the same prime factor, why is this?
Need URGENT help, please!
Thank you all <3