Check if a value is a natural number
Project description
is-natural-number
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.
Install
pip install is_natural_number
Usage
from is_natural_number import isNaturalNumber
isNaturalNumber(5) // True
isNaturalNumber(0) // False
isNaturalNumber(0, True) // True
isNaturalNumber(-5) // False
isNaturalNumber('-45') // False
API
isNaturalNumber(value, includeZero)
value: int, str
- Value to check
includeZero: bool
- Whether or not to consider 0
as a natural number.
Test
python test.py
Contribute
Don't be scared raise an issue or a pull request! Any contributions, no matter how big or small will land your picture here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for is_natural_number-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d61d664426ad20420f3af5357da9f3d794b51194b2c5aff058c2578a6aed650f |
|
MD5 | bb1f719123d42fbc7835b7b23f5c148d |
|
BLAKE2b-256 | da4ffcf9ad6b11f686b087330a7ab0a858e2f788c966a1f8fc508ba18ac01946 |