I am looking for the best way (fast and elegant) to get a random boolean in python (flip a coin).
For the moment I am using random.randint(0, 1)
or random.getrandbits(1)
.
Are there better choices that I am not aware of?
I am looking for the best way (fast and elegant) to get a random boolean in python (flip a coin).
For the moment I am using random.randint(0, 1)
or random.getrandbits(1)
.
Are there better choices that I am not aware of?
I like