tjreedy at udel.edu
Tue Apr 15 23:54:55 CEST 2003
"Peter Hansen" <peter at engcorp.com> wrote in message
news:3E9C5035.F52E63BB at engcorp.com...
> c = 3
> print '\n'.join([' '.join([myList[i] for i in range(s, len(myList),
> for s in range(len(myList)/c+1)])
> Note: relies on current integer division, otherwise you need to add
> int() call in the last bit.
You can guarantee future truncating behavior by using // instead of /
More information about the Python-list