A basic number tools package
Project description
num_tool
Basic number tools package
Features:
Random numbers list:
from num_tool import random_num_list
print(random_num_list(0, 5, length=20))
- returns a list with length random values in the range a, b
Example:
[5, 0, 1, 0, 0, 1, 5, 3, 3, 3, 5, 3, 1, 0, 3, 0, 5, 1, 2, 4]
Count Duplicates:
from num_tool import count_duplicates
print(count_duplicates([0, 0, 1, 1, 2, 1, 3, 2]))
- returns a dictionary with the duplicates
Example:
{0: 2, 1: 3, 2: 2, 3: 1}
Remove Duplicates:
from num_tool import remove_duplicates
print(remove_duplicates([0, 0, 1, 1, 2, 1, 3, 2]))
- returns the list without duplicates
Example:
[0, 1, 2, 3]
is prime:
from num_tool import is_prime
print(is_prime(3))
- returns True if the number given is a prime number
Example:
True
is even:
from num_tool import is_even
print(is_even(10))
- returns True if the number given is an even number
Example:
True
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
num_tool-0.0.20.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for num_tool-0.0.20-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3899b8e0b18632dc3c3760fb68f346517a55c8f07022eb9a1bee164f16c5101e |
|
MD5 | ab9e3cd99e5eadf55fa41053a196ba49 |
|
BLAKE2b-256 | ba77ef80c4beec5661cef4b96eeec99bb292d799bf1b3ba070989e5463c415ba |