Skip to main content

Adjustable random number generator

Project description

More adjustable random functions

Generating adjustable random values, from min to max with numbers to adjust.

For example, we have values from 1 to 10.

If number 2 and 3 will be in numbers to adjust with k=5, final array will look like this:

[1,2,2,2,2,2,3,3,3,3,3,4,5,6,7,8,9,10]

and chance of random.choice for those values will be increased

Examples

Run basic functions

from adjustable_random import (
    get_adjustable_random_list,
    get_adjustable_random_value
)

if __name__ == '__main__':

    adjustable_list: list[int] = get_adjustable_random_list(
        min_value=0,
        max_value=100,
        numbers_to_adjust=[
            10,15
        ]
    )
    adjustable_value: int = get_adjustable_random_value(
        min_value=0,
        max_value=100,
        numbers_to_adjust=[
            10,15
        ]
    )

    print(f"{adjustable_list=}")
    print(f"{adjustable_value=}")

Run tests to see how it works

from adjustable_random import (
    init_random_values,
    run_graph_test
)

if __name__ == '__main__':
    values: list[int] = init_random_values()
    run_graph_test(values)

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

adjustable_random package-1.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

adjustable_random_package-1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file adjustable_random package-1.1.tar.gz.

File metadata

File hashes

Hashes for adjustable_random package-1.1.tar.gz
Algorithm Hash digest
SHA256 848638d5f1fdac982bd8501767af8c9ce218d669d232aff667cf41bbb15f76c0
MD5 a17592bf84c1c770949bec7a560a7327
BLAKE2b-256 171d1b70d97c9b77fb5747d895aa658057b706efef207eab6a11efd56d26297b

See more details on using hashes here.

File details

Details for the file adjustable_random_package-1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for adjustable_random_package-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2052c40d528a598560549b09acf26ac2bb116e020926add5a99c059b6e16f56e
MD5 35f75bb44aa0aa6655c183aeff66e198
BLAKE2b-256 78306297942fefe3f13938705bf36e1d8bcc1c39ef2aa0cf3652da59c029963a

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