📌  相关文章
📜  python 列表中的随机元素 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:29.391000             🧑  作者: Mango

代码示例3
animal = ["monkey","cat","goat","cow","horse","snake","dog"]
randomlst = []
n = len(animal)
for i in random.sample(range(0,n),n):
    randomlst.append(animal[i])
print(randomlst)