a=[0,1,2,3,4,5,6,7,8,9,0] n=3 b=[[a[i:i+3]] for i in range(0,len(a),n)]