Answers for "random boolean python"

3

python random true false

bool(random.getrandbits(1)) #is still about twice as fast as random.choice([True, False])
Posted by: Guest on May-07-2020
0

random boolean python

import random
bool(random.getrandbits(1))
Posted by: Guest on April-14-2021

Python Answers by Framework

Browse Popular Code Answers by Language