What does itertools.chain(, ) produce when iterated?
Correct answer A. 1, 2, 3
Explanation
itertools.chain() returns an iterator that yields every element of the first iterable, then every element of the next, and so on, treating several sequences as one continuous stream. It does not pair items like zip() and does not nest them. It is lazy, so nothing is copied up front.
Answer checked How we write and check questions
Discussion