13.13. Iterator Itertools

  • Learn more at https://docs.python.org/3/library/itertools.html

  • More information in Itertools

  • itertools.count(start=0, step=1)

  • itertools.cycle(iterable)

  • itertools.repeat(object[, times])

  • itertools.accumulate(iterable[, func, *, initial=None])

  • itertools.chain(*iterables)

  • itertools.compress(data, selectors)

  • itertools.islice(iterable, start, stop[, step])

  • itertools.starmap(function, iterable)

  • itertools.product(*iterables, repeat=1)

  • itertools.permutations(iterable, r=None)

  • itertools.combinations(iterable, r)

  • itertools.combinations_with_replacement(iterable, r)

  • itertools.groupby(iterable, key=None)