简单问题:percent_chance = 0.36
if <don't know what>: #action here has 36% chance to execute pass
我怎么解决这个问题?
您可以使用random.random:
random.random
>>> import random >>> if random.random() < percentage_chance: print('aaa')