You can download this code by clicking the button below.
This code is now available for download.
This function merges multiple iterable objects (like lists, strings, etc.) into a single iterable. If the iterables are of uneven length, missing values are filled with `fillvalue`.
Technology Stack : itertools
Code Type : Function
Code Difficulty : Intermediate
def zip_longest(*args, fillvalue=None):
"""
Zip the elements of the provided iterables together into a single iterable.
If the iterables are of uneven length, missing values are filled with `fillvalue`.
"""
from itertools import zip_longest as _zip_longest
return _zip_longest(*args, fillvalue=fillvalue)