Answers for "how to slice a list at a particular number in python"

0

python slice a list a specific amount of times

def even_divide(lst, num_piece=4):
    return [
        [lst[i] for i in range(len(lst)) if (i % num_piece) == r]
        for r in range(num_piece)
    ]
Posted by: Guest on May-02-2020

Code answers related to "how to slice a list at a particular number in python"

Python Answers by Framework

Browse Popular Code Answers by Language