2008-10-11から1日間の記事一覧

3.0のメモ

C:\Python30\Lib\test\test_itertools.pyからのメモ >>> from itertools import * >>> >>> seq = range(4) >>> a, b = tee(seq) >>> next(b) 0 >>> list(zip(a, cycle(b))) [(0, 1), (1, 2), (2, 3), (3, 1)] >>> >>> seq = [1, 2, 3] >>> pairs = [(2**i, x…