Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

create n sublists python

def sublist(lst, n):
    sub=[] ; result=[]
    for i in lst:
        sub+=[i]
        if len(sub)==n: result+=[sub] ; sub=[]
    if sub: result+=[sub]
    return result
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #sublists #python
ADD COMMENT
Topic
Name
5+1 =