import random def toss_coin(): # 0代表正面,1代表反面 return "正面" if random.randint(0, 1) == 0 else "反面" # 擲硬幣 result = toss_coin() print(f"擲出的結果是:{result}")