this isn' necessary in (see if you've forgotten this requirementbecause map expects function to be passed in and appliedit also happens to be one of the places where lambda commonly appearslist(map((lambda xx )counters)[ function expression herethe function adds to each item in the counters listas this little function isn' needed elsewhereit was written inline as lambda because such uses of map are equivalent to for loopswith little extra code you can always code general mapping utility yourselfdef mymap(funcseq)res [for in seqres append(func( )return res assuming the function inc is still as it was when it was shown previouslywe can map it across sequence (or other iterablewith either the built-in or our equivalentlist(map(inc[ ])[ mymap(inc[ ][ built-in is an iterable ours builds list (see generatorshoweveras map is built-init' always availablealways works the same wayand has some performance benefits (as we'll prove in it' faster than manually coded for loop in some usage modesmoreovermap can be used in more advanced ways than shown here for instancegiven multiple sequence argumentsit sends items taken from sequences in parallel as distinct arguments to the functionpow( ** list(map(pow[ ][ ]) ** ** ** [ with multiple sequencesmap expects an -argument function for sequences herethe pow function takes two arguments on each call--one from each sequence passed to map it' not much extra work to simulate this multiple-sequence generality in codetoobut we'll postpone doing so until later in the next after we've met some additional iteration tools the map call is similar to the list comprehension expressions we studied in and will revisit in the next from functional perspectivelist(map(inc[ ])[ [inc(xfor in [ ][ use (parens to generate items instead in some casesmap may be faster to run than list comprehension ( when mapping built-in function)and it may also require less coding on the other handbecause functional programming tools