You can download this code by clicking the button below.
This code is now available for download.
Create an iterator that returns tuples, filling with a specified value if the iterators are exhausted.
Technology Stack : Create an iterator that returns tuples, filling with a specified value if the iterators are exhausted. It uses the `itertools` module.
Code Type : Function
Code Difficulty : Intermediate
def zip_longest(*args, fillvalue=()):
from itertools import zip_longest as _zip_longest
return _zip_longest(*args, fillvalue=fillvalue)