Printing Columns

David Lewis DavidMLewis.NO at SPAM.mac.com
Wed Apr 16 01:31:00 CEST 2003


In article <3E9C788F.74CDC1FA at engcorp.com>, Peter Hansen
<peter at engcorp.com> wrote:

> 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.
> 
You are correct and I apologize. I'd forgotten that extended slice
notation was one of the additions.

Best,
   David




More information about the Python-list mailing list