Produces combinations of iterable elements of length r with replacement: identical elements can occur in together in some combinations.
Example: combinations_with_replacement(‘ABC’, 2) –> AA AB AC BB BC CC
From Python 2.6 docs under the Python Software Foundation License
Args: |
|
---|---|
Returns: | A generator yielding combinations (with replacement) of length r |