Skip to main content

Use to find prime numbers

Project description

Using the “primenumber” 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]

3.(Only available in package version 1.1.0) You can use the function all_PrimeNumbers_inRange() .

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]

Keep an eye for new releases. Thank You. Feel free to mail me for improvements and suggestions.

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.0.zip (1.0 kB view hashes)

Uploaded Source

Supported by

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