A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-November/050122.html below:

[Python-Dev] Re: String literal concatenation & docstrings

[Python-Dev] Re: String literal concatenation & docstrings [Python-Dev] Re: String literal concatenation & docstringsDavid Goodger goodger at python.org
Sat Nov 27 16:07:15 CET 2004
[Carlos Ribeiro]
>  while the following works:
> 
>     a = "this line continues"
>         "on the next line"

Are you sure about that?  Doesn't work on my machine:

$ cat x.py
a = "this line continues "
     "on the next line"
$ python x.py
   File "x.py", line 2
     "on the next line"
     ^
SyntaxError: invalid syntax

If you add a trailing backslash, it does work:

$ cat x2.py
a = "this line continues " \
     "on the next line"
print a
$ python x2.py
this line continues on the next line

 > Kind of weird

Not weird at all ;-)

-- 
David Goodger <http://python.net/~goodger>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://mail.python.org/pipermail/python-dev/attachments/20041127/b6e5ec3c/signature.pgp
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4