How do you make a higher order function in Python?

Answer Posted / chaitanya

A higher-order function accepts one or more functions as input and returns a new function. Sometimes it is required to use function as data

To make high order function , we need to import functools module

The functools.partial() function is used often for high order function.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does a function return values?

481


Why are tuples immutable?

464


Can we write else statement try block in python?

448


How do I run a script in python shell?

471


What is enumerate python?

453






When do you use list vs. tuple vs. dictionary vs. set?

508


What is a function in python programming?

484


What is setup cfg?

473


How to concatenate two lists in python?

480


Is python too slow?

550


What is the use of dir() function?

475


Are functions objects in python?

460


What is python shell and idle?

469


Explain between deep and shallow copy?

464


What is split() function?

502