装饰器前奏2(2017年8月23日 11:50:39)(2017年8月29日 16:07:32)
生活随笔
收集整理的這篇文章主要介紹了
装饰器前奏2(2017年8月23日 11:50:39)(2017年8月29日 16:07:32)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
?
門牌號的作用是讓人找到這個房間
門牌號沒有的話 就會清空里面的內(nèi)容(python的內(nèi)存回收機制)
函數(shù)就是變量
?
匿名函數(shù)(沒有函數(shù)名)
calc = lambda x:x*3print(calc(3))?
?
?
函數(shù)只要定義了,就能調(diào)用。
函數(shù)就是一種變量(加引號的變量)
# def foo(): # print('in the foo') # bar() # foo()#只要定義了,就能調(diào)用 def bar():print('in the bar') def foo():print('in the foo')bar() foo()def foo():print('in the foo')bar() def bar():print('in the bar') foo()# def foo() # print('in the foo') # bar() # foo() # def bar() # print('in the bar')
?
轉(zhuǎn)載于:https://www.cnblogs.com/yeison/p/7419476.html
總結(jié)
以上是生活随笔為你收集整理的装饰器前奏2(2017年8月23日 11:50:39)(2017年8月29日 16:07:32)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: stdafx.h 的作用
- 下一篇: React+dva+antd的运用