CP

Useful Functions

isslice(iterator, start, end)

to slice iterators

def values(n: int) -> Iterator[int]:
    for i in range(n):
        yield i
  
islice(values(100), 20, 31) # -> [20, 21, 22, ..., 30]

On this page