Answers for "how to pass function as paraemter of another function pythpn"

C#
0

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))
Posted by: Guest on September-02-2021

Code answers related to "how to pass function as paraemter of another function pythpn"

C# Answers by Framework

Browse Popular Code Answers by Language