Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 374 Bytes

24.md

File metadata and controls

22 lines (16 loc) · 374 Bytes
@author jackzhenguo
@desc 
@date 2019/2/25

24 操作函数对象

In [31]: def f():
    ...:     print('i\'m f')

In [32]: def g():
    ...:     print('i\'m g')

In [33]: [f,g][1]()
i'm g

创建函数对象的list,根据想要调用的index,方便统一调用。

[上一个例子](23.md) [下一个例子](25.md)