Skip to content

Instantly share code, notes, and snippets.

@thanakijwanavit
Created April 28, 2020 09:27
Show Gist options
  • Save thanakijwanavit/ca5fcb039c5c6bfe77992d267d8cddf7 to your computer and use it in GitHub Desktop.
Save thanakijwanavit/ca5fcb039c5c6bfe77992d267d8cddf7 to your computer and use it in GitHub Desktop.
split list into sublists
def splitList(l,n):
x = [l[i:i + n] for i in range(0, len(l), n)]
return x
splitList(l,n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment