假设我有一组未分类的项目:
input = set([45, 235, 3, 77, 55, 80, 154])
我需要从此输入中获取随机值,但是在特定范围内.比如我有
ran = [50, 100]
我想让它返回77或55或80.在python中获取大型集合的最快方法是什么?
python random algorithm
algorithm ×1
python ×1
random ×1