#a为可迭代对象list,总数据
#task1,2,3,4分别平均获取a对象值
a = [1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]
print len(a)
n = 4
task1=[]
task2=[]
task3=[]
task4=[]
for b in [a[i:i + n] for i in range(0, len(a), n)]:
if len(b)==4:
task1.append(b[0])
task2.append(b[1])
task3.append(b[2])
task4.append(b[3])
elif len(b)==3:
task1.append(b[0])
task2.append(b[1])
task3.append(b[2])
elif len(b)==2:
task1.append(b[0])
task2.append(b[1])
else:
task1.append(b[0])
print "1:",task1
print "2:",task2
print "3:",task3
print "4:",task4
all_list=[]
all_list.append(task1)
all_list.append(task2)
all_list.append(task3)
all_list.append(task4)
print all_list