Printing Columns
Peter Hansen
peter at engcorp.com
Tue Apr 15 17:24:31 EDT 2003
David Lewis wrote:
>
> This should give you a start:
>
> >>> x = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
> >>> x[0: :3]
> ['a', 'd', 'g']
> >>> x[1: :3]
> ['b', 'e', 'h']
> >>> x[2: :3]
> ['c', 'f']
This kind of response, requiring *alpha* software that is not yet
released and unlikely to be used by the majority of people, deserves
a caveat:
The above will not work with standard versions of Python prior to 2.3.
-Peter
More information about the Python-list
mailing list