📜  python 平均分割范围 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:40.913000             🧑  作者: Mango

代码示例3
def split(a, n):
    k, m = divmod(len(a), n)
    return (a[i*k+min(i, m):(i+1)*k+min(i+1, m)] for i in range(n))