Answers for "split list on every nth element python"

0

split list on every nth element python

def chunks(list_in, n):
    # For item i in a range that is a length of l,
    for i in range(0, len(list_in), n):
        # Create an index range for l of n items:
        yield list_in[i:i+n]
# then just do this to get your output
list(chunks(our_list, cut_every))
Posted by: Guest on April-11-2020

Code answers related to "split list on every nth element python"

Python Answers by Framework

Browse Popular Code Answers by Language