Is your number even or odd tho?
Project description
Am I Even Or Odd
Is your number even or odd tho?
Yes, n % 2 == 0 does the same thing.
Installation
pip install am-i-even-or-odd
Usage
from am_i_even_or_odd import is_it_even_tho, is_it_odd_tho
print(is_it_even_tho(4))
print(is_it_odd_tho(5))
Output
True
True
Error handling
Only int values are accepted. Anything else — floats, strings,
None, booleans — raises a TypeError with a message explaining
why, rather than silently returning a possibly-wrong answer:
>>> is_it_even_tho(4.0)
TypeError: expected an int, got 'float' (4.0). Floats and other
numeric types aren't supported to avoid ambiguity around what
counts as 'even' or 'odd'.
Command line
Installing the package also gives you a CLI:
$ am-i-even-or-odd 42
even
$ am-i-even-or-odd 7 --fun
7 is even! Kidding it's obviously ODD.
--fun swaps the plain even/odd output for a random one-liner
with a bit more personality. Invalid input (non-integers) prints a
usage error and exits with a non-zero status code, so it plays nice
in scripts.
Development
git clone https://github.com/KenKambi/am-i-even-or-odd.git
cd am-i-even-or-odd
pip install -e ".[dev]"
pytest -v
Contributions and issues are welcome — see the issue tracker.
Changelog
See CHANGELOG.md.
License
MIT — see LICENSE.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file am_i_even_or_odd-0.3.0.tar.gz.
File metadata
- Download URL: am_i_even_or_odd-0.3.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b8ba1e999b99c53df094fd029d85162cbfd6aeb17949d5b2b2cc36356e23b4f
|
|
| MD5 |
24f4e0676b688549c69d28a3be45e9c3
|
|
| BLAKE2b-256 |
e12ee9d0ecd54a1d3d56ffbc76cb12e9e3b7fa409b9386b1062a61f4e9386e37
|
Provenance
The following attestation bundles were made for am_i_even_or_odd-0.3.0.tar.gz:
Publisher:
publish.yml on KenKambi/am-i-even-or-odd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
am_i_even_or_odd-0.3.0.tar.gz -
Subject digest:
4b8ba1e999b99c53df094fd029d85162cbfd6aeb17949d5b2b2cc36356e23b4f - Sigstore transparency entry: 2163104501
- Sigstore integration time:
-
Permalink:
KenKambi/am-i-even-or-odd@887a109ea0d0f29ab32c07fc46d15570e8829946 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/KenKambi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@887a109ea0d0f29ab32c07fc46d15570e8829946 -
Trigger Event:
release
-
Statement type:
File details
Details for the file am_i_even_or_odd-0.3.0-py3-none-any.whl.
File metadata
- Download URL: am_i_even_or_odd-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bcf51ffaa2354e6834a0398462bf50717603f98e2d26b6aaad7f5c33daa1e46
|
|
| MD5 |
e2b4daff361921d635b61786d2e0c452
|
|
| BLAKE2b-256 |
4b6e8711b0c13c9036328d5ebf15fec4fac1b170302d8749eb1d2cfdfaa2373e
|
Provenance
The following attestation bundles were made for am_i_even_or_odd-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on KenKambi/am-i-even-or-odd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
am_i_even_or_odd-0.3.0-py3-none-any.whl -
Subject digest:
7bcf51ffaa2354e6834a0398462bf50717603f98e2d26b6aaad7f5c33daa1e46 - Sigstore transparency entry: 2163104515
- Sigstore integration time:
-
Permalink:
KenKambi/am-i-even-or-odd@887a109ea0d0f29ab32c07fc46d15570e8829946 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/KenKambi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@887a109ea0d0f29ab32c07fc46d15570e8829946 -
Trigger Event:
release
-
Statement type: