If the number is negative take the last n numbers of the sequence, which is
effectively the same as drop(length - n) if you know the length of the
length of the iterator.
Note: because the length of the iterator is not known—if you use negative
index the entire iterator has to be consumed before yielding the first item.
This can result in an infinite loop if the iterator is indefinite.
Take a specific number of items from the front sequence and drop the rest.
If the number is negative take the last
nnumbers of the sequence, which is effectively the same asdrop(length - n)if you know the length of the length of the iterator.Note: because the length of the iterator is not known—if you use negative index the entire iterator has to be consumed before yielding the first item. This can result in an infinite loop if the iterator is indefinite.
See also: