📌  相关文章
📜  在每个第 n 个元素上拆分列表 python 代码示例

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

代码示例1
def chunks(list_in, n):
    # For item i in a range that is a length of l,
    for i in range(0, len(list_in), n):
        # Create an index range for l of n items:
        yield list_in[i:i+n]
# then just do this to get your output
list(chunks(our_list, cut_every))