6 lines
202 B
Python
6 lines
202 B
Python
from itertools import islice
|
|
|
|
# From: https://docs.python.org/2/library/itertools.html
|
|
def take(n, iterable):
|
|
""" Return first n items of the iterable as a list """
|
|
return list(islice(iterable, n))
|