設定亂數種子 random.seed(10) # 產生亂數 print(random.random()) ... 串列資料 a = ["A", "B", "C", "D"] # 隨機抽取一個元素 x = random.choice(a) print(x)
確定! 回上一頁