摘要: http://www.pythoncentral.io/python-decorators-overview/ 阅读全文
posted @ 2015-01-30 20:20 eagle_chen 阅读(80) 评论(0) 推荐(0)
摘要: 一般计算fibonacci的方法:1 def fibonacci (n):2 if n == 0 or n == 1:3 return 14 else:5 return fibonacci(n-1) + fibonacci(n-2)这样的call gr... 阅读全文
posted @ 2015-01-29 19:45 eagle_chen 阅读(316) 评论(0) 推荐(0)
摘要: 1 July 2012Ok, perhaps I jest. As a Python instructor, understanding decorators is a topic I find students consistently struggle with upon first expos... 阅读全文
posted @ 2015-01-28 15:21 eagle_chen 阅读(162) 评论(0) 推荐(0)
摘要: 把一个List拆分成2个,使拆分后的List 差最小。如 [1,2,3,4] 拆分成[1,4] [2,3].思路:先把List排序,1.得到最大big和次大small,2.对剩下的List[:-2] 拆分成sBig, sSmall3 把big加到sSmall, small 加到sBig4根据sum(... 阅读全文
posted @ 2015-01-13 09:02 eagle_chen 阅读(257) 评论(0) 推荐(0)