Replicates each item in the iterable for times times.
The iterable which contains the elements to be replicated.
The number of times each element is replicated.
A generator containing the replicated items from iterable.
>>> from iteration_utilities import replicate >>> ''.join(replicate('abc', 3)) 'aaabbbccc'
>>> list(replicate(range(3), 5)) [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2]
Tries to estimate for the length of the instance (returns
0if an estimation is not possible).
(any type) The item that is currently replicated (readonly).
Only available if an item has been replicated.
New in version 0.6.