立即学习:https://edu.csdn.net/course/play/24459/296341?utm_source=blogtoedu
高阶函数
def get_abs(n): #取绝对值方法,python中自己也有方法abc()
return int(str(n).strip("-"))
def add(x,y,f):
return f(x)+f(y)
print(add(5,-10,get_abs))
立即学习:https://edu.csdn.net/course/play/24459/296341?utm_source=blogtoedu
高阶函数
def get_abs(n): #取绝对值方法,python中自己也有方法abc()
return int(str(n).strip("-"))
def add(x,y,f):
return f(x)+f(y)
print(add(5,-10,get_abs))