strings in Python (newbie)

zif zf_acs at DELETETHIShotmail.com
Fri Mar 14 07:18:21 EST 2003


Thanks.

zif

Alex Martelli <aleax at aleax.it> wrote in message
news:7Xica.56121$pG1.1289243 at news1.tin.it...
> zif wrote:
>
> > Thanks, I'll try that as well. Another question: how
> > can I break long text/array elements across multiple
> > lines?
>
> If I'm reading your question correctly, the answer is
> easy -- Python concatenates multiple adjacent "physical"
> lines into a single "logical" line as long as an open
> parens (or bracket) hasn't yet been closed.  So for ex:
>
> longstuff = [ 0, 1, 45, 67, 223, 23,
>               15, 43, 88, 99, 1, 0,
>               23, 24, 42, 15, 0, 2 ]
>
> just works.  Note that indentation is arbitrary for all
> the physical lines except the first one (also known as
> "continuation lines") -- the one I'm showing here is just
> one reasonably popular convention (there are others, too).
>
>
> Alex
>






More information about the Python-list mailing list