函数名的应用

可以作为参数传递给函数:
def func():
      pass
def proxy(fn):
      fn()
proxy(func)
    

 

函数的命名规范和变量一样,函数名其实就是变量名:

可以作为列表中的元素进行存储.
def hanshu1():
  pass
def hanshu2();
  pass
list = [hanshu1,hanshu2]
for el in list:
  el()

  





posted @ 2018-08-10 15:34  学习python1234  阅读(95)  评论(0编辑  收藏  举报
levels of contents