1. map vs. iter

    What's the difference between these?

    >>> zipped = zip(iter1, iter2)
    >>> mapped = map(None, iter1, iter2)
    

    The answer turns out to be depend on whether iter1 and iter2 are the same length. Pretty subtle: zipped is truncated to the length of the shortest of (iter1, iter2). mapped is the same length as …

Page 2 / 4