maths.prime_sieve_eratosthenes ============================== .. py:module:: maths.prime_sieve_eratosthenes .. autoapi-nested-parse:: Sieve of Eratosthenes Input: n = 10 Output: 2 3 5 7 Input: n = 20 Output: 2 3 5 7 11 13 17 19 you can read in detail about this at https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes Attributes ---------- .. autoapisummary:: maths.prime_sieve_eratosthenes.user_num Functions --------- .. autoapisummary:: maths.prime_sieve_eratosthenes.prime_sieve_eratosthenes Module Contents --------------- .. py:function:: prime_sieve_eratosthenes(num: int) -> list[int] Print the prime numbers up to n >>> prime_sieve_eratosthenes(10) [2, 3, 5, 7] >>> prime_sieve_eratosthenes(20) [2, 3, 5, 7, 11, 13, 17, 19] >>> prime_sieve_eratosthenes(2) [2] >>> prime_sieve_eratosthenes(1) [] >>> prime_sieve_eratosthenes(-1) Traceback (most recent call last): ... ValueError: Input must be a positive integer .. py:data:: user_num