Skip to content

Instantly share code, notes, and snippets.

@kadaliao
Created October 24, 2018 04:09
Show Gist options
  • Save kadaliao/4a808ffadca67f7bbbf60c3d7d251660 to your computer and use it in GitHub Desktop.
Save kadaliao/4a808ffadca67f7bbbf60c3d7d251660 to your computer and use it in GitHub Desktop.
等份切割列表
def split_list(li, chunks=1):
for i in range(0, len(li), chunks):
yield li[i:i+chunks]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment