mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
Docs: Fix typo in random_derangement recipe (GH-138599)
This commit is contained in:
parent
bbe00d53e9
commit
c117b03385
1 changed files with 1 additions and 1 deletions
|
|
@ -666,7 +666,7 @@ or the :pypi:`more-itertools` project:
|
|||
"Choose a permutation where no element is in its original position."
|
||||
seq = tuple(iterable)
|
||||
if len(seq) < 2:
|
||||
raise ValueError('derangments require at least two values')
|
||||
raise ValueError('derangements require at least two values')
|
||||
perm = list(seq)
|
||||
while True:
|
||||
random.shuffle(perm)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue