摘要: 1.combinations(iterable,r) 创建一个迭代器,返回iterable中所有长度为r的子序列,返回的子序列中的项按输入iterable中的顺序排序:官方文档def combinations(iterable, r): # combinations('ABCD', 2) --> AB AC AD BC BD CD # combinations(range(4), 3) --> 012 013 023 123 pool = tuple(iterable) n = len(pool) if r > n: return indice... 阅读全文
posted @ 2014-02-19 16:51 天外飞仙丶 阅读(11544) 评论(0) 推荐(0) 编辑