Combining Iterables with Zip Longest

  • Share this:

Code introduction


The function is used to combine multiple iterable objects. If the lengths of these iterables are inconsistent, it fills the shorter sequences with fillvalue.


Technology Stack : itertools

Code Type : Function

Code Difficulty : Intermediate


                
                    
def zip_longest(*args, fillvalue=0):
    from itertools import zip_longest as zip_longest_imp
    return zip_longest_imp(*args, fillvalue=fillvalue)                
              
Tags: