by most definitionstoday' python blends support for multiple programming paradigmsprocedural (with its basic statements)object-oriented (with its classes)and functional for the latter of thesepython includes set of built-ins used for functional programming--tools that apply functions to sequences and other iterables this set includes tools that call functions on an iterable' items (map)filter out items based on test function (filter)and apply functions to pairs of items and running results (reducethough the boundaries are sometimes bit greyby most definitions python' functional programming arsenal also includes the first-class object model explored earlierthe nested scope closures and anonymous function lambdas we met earlier in this part of the bookthe generators and comprehensions we'll be expanding on in the next and perhaps the function and class decorators of this book' final part for our purposes herelet' wrap up this with quick survey of built-in functions that apply other functions to iterables automatically mapping functions over iterablesmap one of the more common things programs do with lists and other sequences is apply an operation to each item and collect the results--selecting columns in database tablesincrementing pay fields of employees in companyparsing email attachmentsand so on python has multiple tools that make such collection-wide operations easy to code for instanceupdating all the counters in list can be done easily with for loopcounters [ updated [for in countersupdated append( add to each item updated [ but because this is such common operationpython also provides built-ins that do most of the work for you the map function applies passed-in function to each item in an iterable object and returns list containing all the function call results for exampledef inc( )return function to be run list(map(inccounters)[ collect results we met map briefly in and as way to apply built-in function to items in an iterable herewe make more general use of it by passing in userdefined function to be applied to each item in the list--map calls inc on each list item and collects all the return values into new list remember that map is an iterable in advanced function topics