Skip to content

Instantly share code, notes, and snippets.

@pat-hanbury
Last active August 1, 2022 09:59
Show Gist options
  • Save pat-hanbury/0d2d3b283b5e5ff8b53f11d78c8d300a to your computer and use it in GitHub Desktop.
Save pat-hanbury/0d2d3b283b5e5ff8b53f11d78c8d300a to your computer and use it in GitHub Desktop.
def get_rand_number(min_value, max_value):
"""
This function gets a random number from a uniform distribution between
the two input values [min_value, max_value] inclusively
Args:
- min_value (float)
- max_value (float)
Return:
- Random number between this range (float)
"""
range = max_value - min_value
choice = random.uniform(0,1)
return min_value + range*choice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment