numprint
Tiny, dependency-free helpers for multiplication tables and parity checks.
Install
pip install git+https://github.com/Hritik00s/numprint.git
Usage
from numprint import print_tables, is_even, parity
print_tables(50)
print_tables(30)
is_even(4)
is_odd(4)
parity(7)
Or from the command line:
$ numprint 12
12 x 1 = 12
12 x 2 = 24
...
12 x 12 = 144
API
print_tables(n, upto=None) | Print the table of n. upto defaults to n. |
table(n, upto=None) | Same, returned as a list of strings. |
is_even(n) | True if n is even. |
is_odd(n) | True if n is odd. |
parity(n) | 'even' or 'odd'. |
Development
pip install -e ".[dev]"
pytest
License
MIT