hosea1008
4/24/2018 - 2:25 PM

等分list

# split list equally
def list_split(l, size):
    # size = (len(l) / x if len(l) % x == 0 else len(l) / x + 1)
    return [l[m:m + size] for m in range(0, len(l), size)]