learntosolveit/source/python/algorithm_eratosthenes.rst at feb4 · uthcode/learntosolveit · GitHub
Skip to content

Latest commit

 

History

History
32 lines (19 loc) · 587 Bytes

File metadata and controls

32 lines (19 loc) · 587 Bytes

Eratosthenes method to find primes

Question

Illustrate the sieve of eratosthenes method to find out prime numbers.

Solution

.. literalinclude:: ../../languages/python/algorithm_eratosthenes.py
   :language: python
   :tab-width: 4

.. runcode:: ../../languages/python/algorithm_eratosthenes.py
   :language: python
   :codesite: ideone

Explanation

.. seealso::

   * :python-suggest-improve:`algorithm_eratosthenes.py`
   * :python-better-explain:`algorithm_eratosthenes.rst`