隨機二元決策
import random
probability = 0.3
if random.random() < probability:
print("Decision with probability 0.3")
else:
print("Decision with probability 0.7")
import random
probability = 0.3
if random.random() < probability:
print("Decision with probability 0.3")
else:
print("Decision with probability 0.7")