Skip to main content

Use to find prime numbers

Project description

Using the “primenumbers” module you can:

  1. Check if a number is prime or not. By using the isprime() function. The result is returned as either True or False.

SYNTAX: isprime(your_number)

Example: >>> import primenumbers >>> primenumbers.isprime(201) >>>False

  1. You can get a list of prime numbers within a specified limit, by using the all_PrimeNumbers_within() function. The result is returned as a list of prime numbers.

SYNTAX: all_PrimeNumbers_within(a_number) #(from 2)

Example: >>> import primenumbers >>> primenumbers.all_PrimeNumbers_within(25) >>>[2, 3, 5, 7, 11, 13, 17, 19, 23]

  1. You can use the function all_PrimeNumbers_inRange() to find prime numbers within a given range. The result is returned as a list of prime numbers.(Only available in package version 1.1.0 or later)

SYNTAX: all_PrimeNumbers_inRange(start_number, end_number)

Example: >>> import primenumbers >>> primenumbers.all_PrimeNumbers_inRange(25, 60) >>>[29, 31, 37, 41, 43, 47, 53, 59]

What New in Version: 1.1.2:

  1. Significantly Faster processing

  2. Removed bug in which ‘1’ is being considered as a prime numbers.

  3. Removed bug in which negative numbers are being considered as a prime numbers.

Keep an eye for new releases. Thank You. Feel free to mail me for improvements and suggestions at chakraborty.anubhab@gmail.com .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

primenumbers-1.1.2.zip (1.0 kB view details)

Uploaded Source

File details

Details for the file primenumbers-1.1.2.zip.

File metadata

  • Download URL: primenumbers-1.1.2.zip
  • Upload date:
  • Size: 1.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for primenumbers-1.1.2.zip
Algorithm Hash digest
SHA256 1eb27ef6058d6f8d33c8efb55e89bb337be24e2241f06a77bdc694945d452999
MD5 ca276c77e98042f9e9ff3fc0ea094b54
BLAKE2b-256 06f254a8bd356e8139e6e0d1dabce9d12f1919ba6ac7c7fd5097cda34e787750

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page