#prime factors - ex.3
primes = [] for possibleprime in range (2,100000,1): isPrime = True for num in range(2, possibleprime, 1): if possibleprime % num == 0: isPrime = False
#prime factors - ex.3
primes = []
for possibleprime in range (2,100000,1):
isPrime = True
for num in range(2, possibleprime, 1):
if possibleprime % num == 0:
isPrime = False
if isPrime:
primes.append(possibleprime)
#print(primes)
def prime(n):
prime_factors = []
n = int(n)
for x in primes:
if n % x == 0:
prime_factors.append(x)
return prime_factors
# n = 13195
# print(prime(n))
n = 600851475143
print(prime(n))
#print(primes)
def prime(n): prime_factors = [] n = int(n) for x in primes: if n % x == 0: prime_factors.append(x) return prime_factors
n = 13195
print(prime(n))
n = 600851475143 print(prime(n))
#prime factors - ex.3
primes = []
for possibleprime in range (2,100000,1):
isPrime = True
for num in range(2, possibleprime, 1):
if possibleprime % num == 0:
isPrime = False
if isPrime:
primes.append(possibleprime)
#print(primes)
def prime(n):
prime_factors = []
n = int(n)
for x in primes:
if n % x == 0:
prime_factors.append(x)
return prime_factors
# n = 13195
# print(prime(n))
n = 600851475143
print(prime(n))