functions are runthe following results are printed-- zipand two padding maps[(' '' ')(' '' ')(' '' ')[(' '' ')(' '' ')(' '' ')(none' ')(none' ')(none' ')[(' '' ')(' '' ')(' '' ')( ' ')( ' ')( ' ')these functions aren' amenable to list comprehension translation because their loops are too specific as beforethoughwhile our zip and map workalikes currently build and return result listsit' just as easy to turn them into generators with yield so that they each return one piece of their result set at time the results are the same as beforebut we need to use list again to force the generators to yield their values for displayusing generatorsyield def myzip(*seqs)seqs [list(sfor in seqswhile all(seqs)yield tuple( pop( for in seqsdef mymappad(*seqspad=none)seqs [list(sfor in seqswhile any(seqs)yield tuple(( pop( if else padfor in seqss 'abc''xyz print(list(myzip( ))print(list(mymappad( ))print(list(mymappad( pad= ))finallyhere' an alternative implementation of our zip and map emulators--rather than deleting arguments from lists with the pop methodthe following versions do their job by calculating the minimum and maximum argument lengths armed with these lengthsit' easy to code nested list comprehensions to step through argument index rangesalternate implementation with lengths def myzip(*seqs)minlen min(len(sfor in seqsreturn [tuple( [ifor in seqsfor in range(minlen)def mymappad(*seqspad=none)maxlen max(len(sfor in seqsindex range(maxlenreturn [tuple(( [iif len(si else padfor in seqsfor in indexs 'abc''xyz print(myzip( )print(mymappad( )print(mymappad( pad= )because these use len and indexingthey assume that arguments are sequences or similarnot arbitrary iterablesmuch like our earlier sequence scramblers and permuters comprehensions and generations