jeudi 30 août 2018

Is it possible to generate a random number in python on a completely open interval or one that is closed on the high end?

I would like to generate a random number n such that n is in the range (a,b) or (a,b] where a < b. Is this possible in python? It seems the only choices are a + random.random()*(b-a) which is includes [a,b) or random.uniform(a,b) which includes the range [a,b] so neither meet my needs.




Aucun commentaire:

Enregistrer un commentaire