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)
评论列表
文章目录