12 2015 档案

摘要:1 def square_add(func): 2 def new_function1(*args, **kwargs): 3 result = func(*args, **kwargs) 4 return result ** 2 5 return ... 阅读全文
posted @ 2015-12-24 15:33 翌逍 阅读(258) 评论(0) 推荐(0)
摘要:1 def triangles():2 c = [1]3 while 1:4 yield c5 a,b=[0]+c,c+[0]6 c=[a[i]+b[i] for i in range(len(a))]1 n = 02 for t in... 阅读全文
posted @ 2015-12-04 14:54 翌逍 阅读(477) 评论(0) 推荐(0)
摘要:先上用Python写的十进制转二进制的函数代码: 1 def Dec2Bin(dec): 2 result = '' 3 4 if dec: 5 result = Dec2Bin(dec//2) 6 return result + str(d... 阅读全文
posted @ 2015-12-03 15:49 翌逍 阅读(6098) 评论(1) 推荐(4)