random.uniform()
random.uniform() is a Python function in the Random Module category. Returns a random float N such that a <= N <= b (or b <= N <= a if b < a). The syntax is random.uniform(a, b). Parameters: a, b — bounds. Returns: Float. A typical example: random.uniform(5.0, 10.0) # 7.3421198445486. A close sibling is random.random(), which returns a random float in the range [0.0, 1.0). A close sibling is random.randint(), which returns a random integer N such that a <= N <= b. A close sibling is random.choice(), which returns a random element from a non-empty sequence. A close sibling is random.choices(), which returns a list of k random elements with optional weights (allows duplicates). More about this category: Random number generation — random, randint, choice, shuffle, sample. Related Random Module entries: random.random(), random.randint(), random.choice(), random.choices(), random.sample(), random.shuffle().