Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
oorrja
GitHub Repository: oorrja/learntosolveit
Path: blob/master/source/python/algorithm_eratosthenes.rst
1241 views
==================================
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`