Answers for "how to use the random function to generate true or false in python"

4

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

Code answers related to "how to use the random function to generate true or false in python"

Python Answers by Framework

Browse Popular Code Answers by Language