Skip to main content

Generate numbers in a certain range / Get True/False according to a certain percentage

Project description

Generate numbers in a certain range / Get True/False according to a certain percentage

$pip install generate-random-values-in-range

from generate_random_values_in_range import randomize_number,get_true_false_percent





for _ in range(200):

    randval = randomize_number(

        value=620,

        percent=20,

        percentage_substract_vs_add=70,

        minimum_to_allow=580,

        maximum_to_allow=700,

    )

    if _ % 20 == 0:

        print("")

    print(randval, end=" ")



694 666 643 580 614 619 700 700 580 653 700 580 583 603 646 700 580 609 580 580 

580 580 580 700 580 700 697 580 700 614 580 649 580 610 600 582 580 580 587 580 

605 580 580 595 602 620 584 592 700 700 698 580 580 609 580 622 644 580 580 580 

590 580 652 591 666 607 580 610 580 580 580 594 615 580 594 580 612 679 607 580 

639 700 621 665 587 622 585 580 599 580 580 600 580 580 700 700 580 580 599 580 

610 580 596 580 696 580 661 589 589 618 612 580 580 580 635 634 580 580 606 580 

581 580 612 580 580 580 602 580 580 700 580 580 580 580 700 580 580 580 691 609 

580 580 648 580 580 580 605 580 580 580 700 699 615 580 643 700 580 595 700 580 

697 580 580 630 580 580 585 582 580 593 619 580 596 688 580 581 700 580 580 580 

627 580 580 580 584 598 580 610 580 583 590 700 580 675 580 684 580 590 580 700 





for _ in range(100):

    randval = get_true_false_percent(percent_true=80)

    if _ % 20 == 0:

        print("")

    if randval is True:

        print(randval, end="  ")

    else:

        print(randval, end=" ")



True  False True  True  True  False True  True  True  True  True  True  True  True  True  True  True  True  True  True  

True  True  False True  True  False True  True  True  True  True  True  True  True  True  True  True  True  True  True  

True  True  True  True  True  False True  True  False True  True  True  True  True  True  True  True  False True  True  

False True  True  True  True  True  True  False False True  True  True  True  True  True  True  True  True  True  False 

True  True  False True  True  True  True  True  True  True  True  True  True  False True  True  True  False True  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

generate_random_values_in_range-0.10.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file generate_random_values_in_range-0.10.tar.gz.

File metadata

File hashes

Hashes for generate_random_values_in_range-0.10.tar.gz
Algorithm Hash digest
SHA256 25915087d99b253d73bad10920d8c0bf24bbc4741dceb8808a2ead2461a4ef05
MD5 265b62369a316cdf0c10d02627d99e82
BLAKE2b-256 dcf6ede9f25168bb7bb4499935643f9472be918a9a72f6343d75bc6ccf7f941d

See more details on using hashes here.

File details

Details for the file generate_random_values_in_range-0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for generate_random_values_in_range-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 3f223d9aadc19db61cdcb6e217e2a7de6385c4d78e91fc9cb1035f5fbdce5646
MD5 cb61d3a01366e3dd847fba55c43afcb8
BLAKE2b-256 4b95162b0ed31845173ea697739741634206d95238372087a72f35924dfa5b0e

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