摘要:
def hello(fn): def wrapper(): print "hello" fn() print "goodby" return wrapper@hello #@注解语法糖 # @作用:解释器会解释成下面这样的语句: #test()等价于test=hello(test)def test( 阅读全文
摘要:
def mumber(a): def add(b): return a*b return addif __name__=="__main__": c=mumber(2) d=c(5) print d 阅读全文
摘要:
http://www.zhihu.com/question/37904398?sort=created&page=2 >>> a = [[1,2],[3,4],[5,6,7]]>>> print sum(a,[])[1, 2, 3, 4, 5, 6, 7] >>> l = [1,2,3]>>> l[ 阅读全文