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
 
PREVIOUS NEXT
Tagged: #Passing #function #argument #Python
ADD COMMENT
Topic
Name
1+9 =