You can download this code by clicking the button below.
This code is now available for download.
The function combines multiple iterable objects into an iterator, and if one iterable is exhausted, it fills the remaining positions with fillvalue.
Technology Stack : itertools
Code Type : Function
Code Difficulty : Intermediate
def zip_longest(*args, fillvalue=0):
"""
从a~z的顺序,使用了zip_longest函数。
"""
from itertools import zip_longest
return list(zip_longest(*args, fillvalue=fillvalue))