参考:https://docs.python.org/zh-cn/3/library/random.html 数组中随机选取n个元素 L = [1,2,3,4,5] slice = random.sample(L,3) >>slice >>[3, 5, 4] 随机选取一个元素 L = [1……