test_random.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:privcount 作者: privcount 项目源码 文件源码
def random_value(modulus):
    '''
    call python's random.randrange(modulus)
    '''
    # random.randrange() takes one argument: a maximum value
    # and returns a random value in [0, modulus)
    # it is *NOT* uniformy distributed in python versions < 3.2
    # but this test is not sophisticated enough to pick that up
    # https://docs.python.org/3.5/library/random.html#random.randrange
    return SystemRandom().randrange(modulus)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号