Created
April 28, 2020 09:27
-
-
Save thanakijwanavit/ca5fcb039c5c6bfe77992d267d8cddf7 to your computer and use it in GitHub Desktop.
split list into sublists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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