Goodspeed

导航

2011年10月31日 #

python小技巧汇总

摘要: # -*- coding: UTF-8 -*-#!/usr/bin/env pythondef pairwise(iterable): """ 交叉形成字典 """ itnext = iter(iterable).next while True: yield itnext(),itnext()def distinct(seq): """ 对序列进行去重 """ return dict.fromkeys(L).keys() if __name__ == '__main_ 阅读全文

posted @ 2011-10-31 17:37 Goodspeed 阅读(379) 评论(0) 推荐(0) 编辑