Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0560fe3 commit abb1ab6Copy full SHA for abb1ab6
Doc/library/random.rst
@@ -589,7 +589,8 @@ from the combinatoric iterators in the :mod:`itertools` module:
589
return tuple(pool[i] for i in indices)
590
591
def random_combination_with_replacement(iterable, r):
592
- "Random selection from itertools.combinations_with_replacement(iterable, r)"
+ "Choose r elements with replacement. Order the result to match the iterable."
593
+ # Result will be in set(itertools.combinations_with_replacement(iterable, r)).
594
pool = tuple(iterable)
595
n = len(pool)
596
indices = sorted(random.choices(range(n), k=r))
0 commit comments