Python function / higher-order functions

 
 
the Add DEF (X, Y, F):
     return F (X) + F (Y) 

DEF the make (X): 
    return X + 10 
Print the Add ( . 3 , - . 8 , the make) # 15 is outputted results

Write higher-order functions, it is to make the function parameters can receive other functions.

 

Guess you like

Origin www.cnblogs.com/jkklearn/p/11297878.html