Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to pass function as paraemter of another function pythpn

def add(a, b):
    return a + b

def mul(a, b):
    return a * b

def calculate(a, b, func): #calculate is higher order function
    return func(a, b)

print(calculate(2, 3, mul))
 
PREVIOUS NEXT
Tagged: #pass #function #paraemter #function #pythpn
ADD COMMENT
Topic
Name
5+4 =