Current version:
def chop(ar,size):
p=len(ar)/size
for i in xrange(p):
yield ar[(i*size):((i+1)*size)]
ar is type of list().
What i want is that chop() takes iterator and return iterator.
for i in chop(xrange(9),3):
for j in i:
print j,
print
prints
0 1 2
3 4 5
6 7 8