摘要: #用filter求素数#生成器,生成一个无限序列def _odd_iter(): n=1 while True: n=n+2 yield n#筛选函数def _not_divisible(n): return lambda x:x%n>0 #生成器... 阅读全文
posted @ 2015-08-24 21:23 Entropy_lxl 阅读(1217) 评论(0) 推荐(0) 编辑
摘要: 1 def str2int(s):2 def fn(x,y):3 return x+y4 def char2num(s):5 return {'0':0,'1':1,'2':2,'3':3,'4':4,'5':5,'6':6,'7':7,'8':8,'... 阅读全文
posted @ 2015-08-24 21:04 Entropy_lxl 阅读(4912) 评论(0) 推荐(0) 编辑