You can download this code by clicking the button below.
This code is now available for download.
Combines variable length sequences into one sequence, filling the shorter sequences with a specified fill value if they are not equal in length.
Technology Stack : itertools
Code Type : Function
Code Difficulty : Intermediate
def zip_longest(*args, fillvalue=0):
from itertools import zip_longest
return list(zip_longest(*args, fillvalue=fillvalue))