def choplist(n, seq):
 r = []
 for x in seq:
  r.append(x)
  if (len(r) == n):
   (yield tuple(r))
   r = []
 return

def choplist ( n , seq ) : r = [ ] for x in seq : r . append ( x ) if ( len ( r ) == n ) : ( yield tuple ( r ) ) r = [ ] return
groups every n elements of the list .