From 79107c467ea26219e0fcad859d010934dd613a62 Mon Sep 17 00:00:00 2001 From: Shaun Setlock Date: Sun, 19 Apr 2020 13:59:02 -0400 Subject: [PATCH] Automatic commit performed through alias... --- problems/003_problem.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/problems/003_problem.py b/problems/003_problem.py index a443872..edd0f73 100644 --- a/problems/003_problem.py +++ b/problems/003_problem.py @@ -15,7 +15,17 @@ import time # prime number when supplied with an # intitial integer. -def return_next_prime(start_n,max_n): +def primes_gen(start_n,max_n): + """ + Returns a generator object, containing the + primes inside a specified range. + + primes_gen(start_n,max_n) + + param 'start_n': Previous prime. + param 'max_n': Maximum + + """ start_n += 1 for candidate in range(start_n,max_n): @@ -37,18 +47,20 @@ def main(): result1 = orig = 600851475143 returned_prime = prime_start = 2 - factor_list = [] + prime_factor_list = [] while returned_prime < orig ** 0.5 and returned_prime