2-1 python to function as a parameter
1 def add(x, y, f): 2 return f(x) + f(y)
If passed as a parameter f abs values:
1 add(-5, 9, abs)
The function definition, function code is actually executed:
1 abs(-5) + abs(9)
Since the parameters x, y and f are arbitrary pass, if passed to other functions f, it can be a different return value.