Files
Obsidian-Main/05. 資料收集/Programming/Python/sample().md

141 B
Raw Blame History

從一個list中選出n個不重複的項目

import random
random.sample(seq, n)

不像 choices() 是會重複的。