Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/notbobthebuilder/python-primes
Calculate Prime Numbers in Python & check primality
https://github.com/notbobthebuilder/python-primes
Last synced: 7 days ago
JSON representation
Calculate Prime Numbers in Python & check primality
- Host: GitHub
- URL: https://github.com/notbobthebuilder/python-primes
- Owner: NotBobTheBuilder
- License: mit
- Created: 2014-04-11T22:17:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-04-18T13:06:33.000Z (over 10 years ago)
- Last Synced: 2024-04-14T18:06:05.130Z (7 months ago)
- Language: Python
- Homepage:
- Size: 148 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
python-primes
=============Example Usage:
from primes import Primes
Primes() #Infinite, lazily evaluated prime series
Primes(7) #All prime numbers up to and including 7
list(Primes(7)) == [2, 3, 5, 7]
Calling `Primes()` gives a new iterable of the primes series. It is recommended to call this once, store and reuse that value, as prime numbers are continually cached as they're evaluated.Recommended Use:
from primes import Primes
primes = Primes()
7 in primes == True
4 in primes == False