kyu_5.master_your_primes_sieve_with_memoization package

Submodules

kyu_5.master_your_primes_sieve_with_memoization.primes module

kyu_5.master_your_primes_sieve_with_memoization.primes.is_prime(n)[source]

A function that checks if a given number n is a prime looping through it and, possibly, expanding the array/list of known primes only if/when necessary (ie: as soon as you check for a potential prime which is greater than a given threshold for each n, stop). :param n: :return:

kyu_5.master_your_primes_sieve_with_memoization.test_primes module

class kyu_5.master_your_primes_sieve_with_memoization.test_primes.PrimesTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing is_prime function

test_primes()[source]

Testing a function that checks if a given number n is a prime looping through it and, possibly, expanding the array/list of known primes only if/when necessary (ie: as soon as you check for a potential prime which is greater than a given threshold for each n, stop).

Returns

Module contents