You can download this code by clicking the button below.
This code is now available for download.
This function takes any number of iterable objects as input and returns an iterator that generates tuples, where each tuple contains elements from each input iterable. If the input iterables have different lengths, missing values from the shorter iterables are filled with empty strings.
Technology Stack : itertools
Code Type : Iterator function
Code Difficulty : Intermediate
def zip(*iterables):
zip_longest = itertools.zip_longest(*iterables, fillvalue='')
return [tuple(item) for item in zip_longest]