Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Doc/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,13 @@ to each other are automatically concatenated. ::
>>> 'Py' 'thon'
'Python'

This feature is particularly useful when you want to break long strings::

>>> text = ('Put several strings within parentheses '
... 'to have them joined together.')
>>> text
'Put several strings within parentheses to have them joined together.'

This only works with two literals though, not with variables or expressions::

>>> prefix = 'Py'
Expand All @@ -233,13 +240,6 @@ If you want to concatenate variables or a variable and a literal, use ``+``::
>>> prefix + 'thon'
'Python'

This feature is particularly useful when you want to break long strings::

>>> text = ('Put several strings within parentheses '
... 'to have them joined together.')
>>> text
'Put several strings within parentheses to have them joined together.'

Strings can be *indexed* (subscripted), with the first character having index 0.
There is no separate character type; a character is simply a string of size
one::
Expand Down