New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

numprint

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

numprint

Tiny dependency-free helpers for multiplication tables and parity checks.

pipPyPI
Version
1.2.0
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

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)     # 50 x 1 ... 50 x 50
print_tables(30)     # 30 x 1 ... 30 x 30

is_even(4)           # True
is_odd(4)            # False
parity(7)            # 'odd'

Or from the command line:

$ numprint 12
12 x 1 = 12
12 x 2 = 24
...
12 x 12 = 144

API

FunctionDescription
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

Keywords

math

FAQs

Related posts