Use random.uniform(a, b):
>>> random.uniform(1.5, 1.9)
1.8733202628557872
if you want generate a random float with N digits to the right of point, you can make this :
round(random.uniform(1,2), N)
the second argument is the number of decimals.
by James Palmer
Use random.uniform(a, b):
>>> random.uniform(1.5, 1.9)
1.8733202628557872
if you want generate a random float with N digits to the right of point, you can make this :
round(random.uniform(1,2), N)
the second argument is the number of decimals.