Building a multiline string

Aahz aahz at pythoncraft.com
Mon Feb 8 18:24:01 EST 2010


In article <cd36d2f3-fdd0-4dd0-ad60-d4d7500e3306 at l26g2000yqd.googlegroups.com>,
lallous  <lallous at lgwm.org> wrote:
>
>x = (
>"line1" # can use comments
>"line2"
>"line3"
>)

You should indent the second and following lines (I changed the name to
"xyz" to make clear that the following lines use a regular Python indent
rather than lining up under the open paren):

xyz = (
    "line1" # can use comments
    "line2"
    "line3"
    )
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

import antigravity



More information about the Python-list mailing list