随机取 list 中的元素

import random
a = [1,2,3,4,5,6,7]
b = random.sample(a, 5)
print b

 

posted on 2017-08-10 17:37  _羌梓花  阅读(339)  评论(0编辑  收藏  举报

导航