Euler 3 Python. Putting the prime numbers into a list
问题 Im still pretty new to python and I'm trying to get all of the prime numbers from 600851475143 into a list. However, I keep getting a random assortment of numbers in the list instead of the prime numbers. I'm not really sure where I am going wrong. Thank you for your time import math factors_list = [] prime_factors = [] def number_factors(s): s = int(math.sqrt(s)) for num in range(2, s): for i in range(2, num): if (num % i) == 0: factors_list.append(num) else: prime_factors.append(num) number