r = [] # 결과 l = 3 # 내부 리스트 갯수 for i in range(20): if len(r) is i//l: r.append([]) r[i//l].append(i) print(r)