"abcd" <[EMAIL PROTECTED]> writes:
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
You can either do that, or you can use parentheses:
x = ( "foo" +
"bar" )
Note
Steve Holden <[EMAIL PROTECTED]> wrote:
> x = "hello world, this is my multiline " \
> "string"
>
> and this would have saved you a run-time string concatenation :)
or use parentheses for an alternative which doesn't need the backslash:
x = ("hello world, this is my multiline "
On Thursday 15 March 2007 15:57, abcd wrote:
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
Needed. Although you can omit the "+".
> x = {'name' : \
> 'bob'}
Not needed b
abcd a écrit :
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
Here you don't need the +
> x = {'name' : \
> 'bob'}
And here you don't need the antislash
> Do I need to
abcd wrote:
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
Yes.
>
> x = {'name' : \
> 'bob'}
No.
You don't need trailing slashes whenever there's a pair of {}, [] or
abcd wrote:
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
>
> x = {'name' : \
> 'bob'}
>
> Do I need to use the "\" in the above examples? When do i need to use
> it?
abcd wrote:
> When do I need to use a trailing slash to separate code over multiple
> lines.
>
> For example:
>
> x = "hello world, this is my multiline " + \
> "string"
>
> x = {'name' : \
> 'bob'}
>
> Do I need to use the "\" in the above examples? When do i need to use
> it?
When do I need to use a trailing slash to separate code over multiple
lines.
For example:
x = "hello world, this is my multiline " + \
"string"
x = {'name' : \
'bob'}
Do I need to use the "\" in the above examples? When do i need to use
it?
--
http://mail.python.org/mailman/li