Home »
Python »
Python programs
Python program to pass function as an argument
Here, we are going to learn how to pass function as an argument in Golang (Go Language)?
Submitted by Shivang Yadav, on March 18, 2021
Python allows programmers to pass functions as arguments to another function.
Such functions that can accept other functions as argument are known as higher-order functions.
Program to pass function as an argument
# Function - foo()
def foo():
print("I am Foo")
# higher-order function -
# koo() accepting foo as parameter
def koo(x):
x()
# function call with other function
# passed as argument
koo(foo)
Output:
I am Foo
Python Basic Programs »