list の 分割
Python で List分割してみたのでメモ #python2.7 def split(list, size): def xxx(size): return lambda list: lambda index: list[index:index+size] return map( xxx(size)(list), range(0, len(list), size)) >>> split(range(10), 3) [0, 1, 2] [3, 4, 5] [6, 7, 8] [9] >>> 余りを最後の要素に押し込む def createRange(size, group): ret = split(range(size), size/group) if size%group