公式にitertoolsのrecipe集があるのでそれのメモ. バージョン: python3.3 参考: itertools — Functions creating iterators for efficient looping — Python 3.7.3 documentation ・take(n,iterable) 最初のn個の要素をリストとして返します from itertools import islice def take(n, iterable): return list(islice(iterable, n)) 例 In [76]: take(3,[1,2,3,4,5]) Out[76]: [1, 2, 3] ・tabulate(function,start=0) function(0),function(1),... を返すイテレータを返します. from iterto