Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Passing function as an argument in Python

def first():
    print("first")

def second():
    print("second")

f = first

s = second


def y(l):
     l()


y(f)
#first
y(s)
#second
Source by www.py4e.com #
 
PREVIOUS NEXT
Tagged: #Passing #function #argument #Python
ADD COMMENT
Topic
Name
6+7 =