Open this example in the interactive library
Source code
from itertools import count, islice
print(list(islice(count(10, 2), 4)))Sample output
[10, 12, 14, 16]

Take a finite slice. A self-contained example using the Python standard library.
Open this example in the interactive library
from itertools import count, islice
print(list(islice(count(10, 2), 4)))[10, 12, 14, 16]