Use random.uniform(a, b):
>>> random.uniform(1.5, 1.9)
1.8733202628557872
More Related Contents:
- Is floating point arbitrary precision available?
- How to suppress scientific notation when printing float values?
- Python JSON serialize a Decimal object
- How to display a float with two decimal places?
- Generate ‘n’ unique random numbers within a range [duplicate]
- Limiting floats to two decimal points
- round() doesn’t seem to be rounding properly
- Binary representation of float in Python (bits not hex)
- Consistently create same random numpy array
- Convert floating point number to a certain precision, and then copy to string
- Python random sample with a generator / iterable / iterator
- ValueError: could not convert string to float: id
- Random row selection in Pandas dataframe
- How to generate random numbers that are different? [duplicate]
- Sampling uniformly distributed random points inside a spherical volume
- python floating number [duplicate]
- Add zeros to a float after the decimal point in Python
- Floating Point Limitations [duplicate]
- How to generate random strings in Python?
- Should I use `random.seed` or `numpy.random.seed` to control random number generation in `scikit-learn`?
- Create random list of integers in Python
- numpy float: 10x slower than builtin in arithmetic operations?
- Python: Random selection per group
- Generating Discrete random variables with specified weights using SciPy or NumPy
- How to hash a string into 8 digits?
- Python – shuffle only some elements of a list
- Random non overlapping circles(with circle number controlled) in python and pygame
- Best way to randomize a list of strings in Python [duplicate]
- Generate random number in range excluding some numbers
- Can Python’s set absence of ordering be considered random order?