You can download this code by clicking the button below.
This code is now available for download.
This function is used to merge multiple iterable objects into a single iterator. If one of the iterable objects is exhausted, fillvalue is used to fill the remaining positions.
Technology Stack : itertools
Code Type : Function
Code Difficulty : Intermediate
def zip_longest(*iterables, fillvalue=None):
# 将多个可迭代对象合并为一个新的迭代器,如果其中一个可迭代对象被耗尽,则用fillvalue填充
from itertools import zip_longest as it_zip_longest
def wrapper(*iterables, fillvalue=None):
return it_zip_longest(*iterables, fillvalue=fillvalue)
return wrapper