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

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.16.tar.gz (2.0 kB view hashes)

Uploaded Source

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