True or false output based on a probability

后端 未结 4 523
梦毁少年i
梦毁少年i 2020-12-09 07:22

Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1?

example of what I mean:

4条回答
提交回复
热议问题