Skip to main content

Check if a value is a natural number

Project description


Check if a value is a natural number.

I'm aspiring to make open-source my full-time work. If you or your company likes the work that I do, please consider supporting me.

Coffee PayPal


pip install is_natural_number


from is_natural_number import isNaturalNumber

isNaturalNumber(5)            // True
isNaturalNumber(0)            // False
isNaturalNumber(0, True)      // True
isNaturalNumber(-5)           // False
isNaturalNumber('-45')        // False


isNaturalNumber(value, includeZero)

value: int, str - Value to check

includeZero: bool - Whether or not to consider 0 as a natural number.




Don't be scared raise an issue or a pull request! Any contributions, no matter how big or small will land your picture here.

Adam Zerella

Project details

Download files

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

Files for is-natural-number, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size is_natural_number-1.0.0-py3-none-any.whl (3.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size is-natural-number-1.0.0.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page