randrange(start, stop)
only takes integer arguments. So how would I get a random number between two float values?
Advertisement
Answer
Use random.uniform(a, b):
>>> import random >>> random.uniform(1.5, 1.9) 1.8733202628557872
randrange(start, stop)
only takes integer arguments. So how would I get a random number between two float values?
Use random.uniform(a, b):
>>> import random >>> random.uniform(1.5, 1.9) 1.8733202628557872