to help you evaluate their roles furtherlet' take quick look at one more example of generators in action that illustrates just how expressive they can be once you know about comprehensionsgeneratorsand other iteration toolsit turns out that emulating many of python' functional built-ins is both straightforward and instructive for examplewe've already seen how the built-in zip and map functions combine iterables and project functions across themrespectively with multiple iterable argumentsmap projects the function across items taken from each iterable in much the same way that zip pairs them ups 'abcs 'xyz list(zip( )[(' '' ')(' '' ')(' '' ')zip pairs itemstruncates at shortest list(zip([- - ])[(- ,)(- ,)( ,)( ,)( ,)list(zip([ ][ ])[( )( )( )map passes paired items to functiontruncates list(map(abs[- - ])[ list(map(pow[ ][ ])[ zip pairs items from iterables single sequence -ary tuples sequencesn-ary tuples single sequence -ary function sequencesn-ary function map and zip accept arbitrary iterables map(lambda xyx yopen('script py')open('script py')['import sys\nimport sys\ ''print(sys path)\nprint(sys path)\ 'etc [ for (xyin zip(open('script py')open('script py'))['import sys\nimport sys\ ''print(sys path)\nprint(sys path)\ 'etc though they're being used for different purposesif you study these examples long enoughyou might notice relationship between zip results and mapped function arguments that our next example can exploit coding your own map(funcalthough the map and zip built-ins are fast and convenientit' always possible to emulate them in code of our own in the preceding for examplewe saw function that emulated the map built-in for single sequence (or other iterableargument it doesn' take much more work to allow for multiple sequencesas the built-in doesmap(funcseqs workalike with zip def mymap(func*seqs)res [for args in zip(*seqs)res append(func(*args)generator functions and expressions