Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python function as argument

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

def calculate(function,a,b):
    return function(a,b)

calculate(sum,3,4)
#returns 7
Source by www.py4e.com #
 
PREVIOUS NEXT
Tagged: #python #function #argument
ADD COMMENT
Topic
Name
6+2 =