Answers for "create n sublists python"

0

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
Posted by: Guest on January-31-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language