Answers for "python group groupe of 2"

0

python group groupe of 2

def grouper(iterable, n, fillvalue=None):
    "Collect data into fixed-length chunks or blocks"
    # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx"
    args = [iter(iterable)] * n
    return zip_longest(*args, fillvalue=fillvalue)
Posted by: Guest on October-08-2021

Python Answers by Framework

Browse Popular Code Answers by Language