Full name
random.uniform
Library
random
Syntax
random.uniform(a, b)
Description
The random.uniform function returns a random number in the range [a, b] drawn from a uniform distribution.
Parameters
- a: Lower limit of the range from which to extract the random number.
- b: Upper limit of the range from which to extract the random number.
Result
The random.uniform function returns a real number.
Examples
We can generate a random number in the range [10.0, 15.0] extracted from a uniform distribution with the following code:
random.uniform(10, 15)
11.410800732549799