[issue40388] random.choice integer overflow v3.5.2

Steven D'Aprano report at bugs.python.org
Sat Apr 25 18:57:44 EDT 2020


Steven D'Aprano <steve+python at pearwood.info> added the comment:

Take your pick between either of these:

random.randrange(1, N)
random.randint(1, N-1)

https://docs.python.org/3/library/random.html#functions-for-integers

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40388>
_______________________________________


More information about the Python-bugs-list mailing list