What is the best way to divide a list into roughly equal parts? For example, if the list has 7 elements and is split it into 2 parts, we want to get 3 elements in o
Using list comprehension:
def divide_list_to_chunks(list_, n): return [list_[start::n] for start in range(n)]