You can download this code by clicking the button below.
This code is now available for download.
This function takes any number of iterables and aggregates them into tuples. If the iterables are of unequal length, missing values are filled with `fillvalue`.
Technology Stack : itertools
Code Type : Function
Code Difficulty : Intermediate
def zip_longest(*args, fillvalue=None):
"""
This function takes any number of iterables and aggregates them into tuples.
If the iterables are of unequal length, missing values are filled with `fillvalue`.
"""
from itertools import zip_longest
return zip_longest(*args, fillvalue=fillvalue)