Skip to main content

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 details)

Uploaded Source

Built Distribution

num_tool-0.0.20-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file num_tool-0.0.20.tar.gz.

File metadata

  • Download URL: num_tool-0.0.20.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.7

File hashes

Hashes for num_tool-0.0.20.tar.gz
Algorithm Hash digest
SHA256 688887a700282888f9bda3bf3b78ec0b4b15a5cd8c29f99eac68fec3e613366c
MD5 4d2f88f199f069ef1d68d5271c998646
BLAKE2b-256 73189a153f1e0be29e90ba78357265f01bb27461365d833dedb27bd84009a71f

See more details on using hashes here.

File details

Details for the file num_tool-0.0.20-py3-none-any.whl.

File metadata

  • Download URL: num_tool-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.7

File hashes

Hashes for num_tool-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 3899b8e0b18632dc3c3760fb68f346517a55c8f07022eb9a1bee164f16c5101e
MD5 ab9e3cd99e5eadf55fa41053a196ba49
BLAKE2b-256 ba77ef80c4beec5661cef4b96eeec99bb292d799bf1b3ba070989e5463c415ba

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page