higher order functions functions that take other functions as argumentsor that return functionsare called higher order functions python contains two built-in higher order functionsfilter(and map(note that in earlier versions of pythonthese functions returned listsin python they return an iteratormaking them much more efficient the map(function provides an easy way to transform each item into an iterable object for examplehere is an efficientcompact way to perform an operation on sequence note the use of the lambda anonymous functionsimilarlywe can use the filter built-in function to filter items in listnote that both map and filter perform the identical function as to what can be achieved by list comprehensions there does not seem to be great deal of difference in the performance characteristics apart from slight performance advantage when using the in built functions map and filter without the lambda operatorcompared to list comprehensions despite thismost style guides recommend the use of list comprehensions over built-in functionspossibly because they tend to be easier to read creating our own higher order functions is one of the hallmarks of functional programming style practical example of how higher order functions can be useful is demonstrated by the following here we are passing the len function as the key to the sort function this waywe can sort list of words by length