Python之路 day3 高阶函数

 1 #!/usr/bin/env python
 2 # -*- coding:utf-8 -*- 
 3 #Author:ersa
 4 
 5 """
 6 变量可以指向函数,函数的参数能接收变量,
 7 那么一个函数就可以接收另一个函数作为参数,
 8 这种函数就称之为高阶函数。
 9 """
10 
11 def add(x,y,f):
12     return f(x)+f(y)
13 
14 res = add(3,-6,abs)
15 print(res)
原文地址:https://www.cnblogs.com/iersa/p/6228962.html