tail

iteration_utilities.tail(iterable, n)

Return an iterator over the last n items.

Parameters:

iterable : iterable

The iterable from which to take the last items.

n : int

How many elements.

Returns:

iterator : iterator

The last n items of iterable as iterator.

Examples

>>> from iteration_utilities import tail
>>> list(tail('ABCDEFG', 3))
['E', 'F', 'G']