All pastes #31680 Raw Edit

Anonymous

public text v1 · immutable
#31680 ·published 2005-11-29 14:09 UTC
rendered paste body
l = [1,2,3,4,5,6,7,8,9,10,11,12,13,14]
print "LST: ", l

#if list has elements that dont fit into a 3 item list
#if len(l)%3!=0:
#    remainder = l[-(len(l)%3):]
#else:
#    remainder = None

items = {}
sub = []
it = 0
count = 0
for each in l:
    print "CURRENT: ",each
    while count<3:
        print "APPENDING: ", l[count]
        sub.append(l[count])
        count+=1
    items["SUB-%s" % count] =sub
print "SUB: ",sub
print "DIC:" ,items

#print "REMAINDER: ", remainder