Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
TypeScript
convert list to list of lists on every n elements python
Torsten Schoeneberg
Programming language:
TypeScript
2021-04-11 00:41:09
0
Q:
convert list to list of lists on every n elements python
A.B
Code:
TypeScript
2021-08-22 06:15:44
n = 5 my_list_of_lists = [my_list[i:i + n] for i in range(0, len(my_list), n)]
0
Tags
python
list
element
Related
group list into sublists python
add 1 to all elements in list python
python all elements in list in another list
python add elements of two lists together
New to Communities?
Join the community