split list in 3 part

Solutions on MaxInterview for split list in 3 part by the best coders in the world

showing results for - "split list in 3 part"
Luisa
11 Sep 2020
1def even_divide(lst, num_piece=4):
2    return [
3        [lst[i] for i in range(len(lst)) if (i % num_piece) == r]
4        for r in range(num_piece)
5    ]