Combining Iterables with Fillvalue

  • Share this:

Code introduction


This function is used to combine iterable objects. If an iterable is too short, it is filled with fillvalue.


Technology Stack : itertools

Code Type : Function

Code Difficulty : Intermediate


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