[docs] [issue33114] random.sample() behavior is unexpected/unclear from docs

Scott Eilerman report at bugs.python.org
Wed Mar 21 11:31:08 EDT 2018


Scott Eilerman <scott.j.eilerman at gmail.com> added the comment:

Sorry, there's a typo in that example. It should look like:


random.seed(fixed_seed)
random.sample(choices, n)[-1]

Then, later, I want the next draw, so I did:

random.seed(fixed_seed)
random.sample(choices, n+1)[-1]

----------

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


More information about the docs mailing list