How do I randomly select more or empty in Python?

Author: Howard0756, Created: 2021-07-23 23:58:32, Updated: 2021-07-24 00:10:58

Thank you for your guidance.

How do I randomly select more or empty in Python?

Now, I want to randomly select an if to loop, like randomly select Duo, go to the if, and when I'm done, I'll randomly select DUO or Kong again.

It's Python. def main:

Random true false assigned to Duo or Kong

while True:

    if Duo:
        ......

    if Kong:
        ......

More

shanzhuIs this a big-ticket strategy?

The Little DreamThe main loop starts with generating a random number each time, and then decides on the corresponding operation based on the random number.