mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
Issue #23921: Standardized documentation whitespace formatting.
Original patch by James Edwards.
This commit is contained in:
parent
387235085c
commit
dba903993a
63 changed files with 445 additions and 409 deletions
|
@ -232,7 +232,7 @@ If you want to concatenate variables or a variable and a literal, use ``+``::
|
|||
This feature is particularly useful when you want to break long strings::
|
||||
|
||||
>>> text = ('Put several strings within parentheses '
|
||||
'to have them joined together.')
|
||||
... 'to have them joined together.')
|
||||
>>> text
|
||||
'Put several strings within parentheses to have them joined together.'
|
||||
|
||||
|
@ -276,11 +276,11 @@ makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::
|
|||
Slice indices have useful defaults; an omitted first index defaults to zero, an
|
||||
omitted second index defaults to the size of the string being sliced. ::
|
||||
|
||||
>>> word[:2] # character from the beginning to position 2 (excluded)
|
||||
>>> word[:2] # character from the beginning to position 2 (excluded)
|
||||
'Py'
|
||||
>>> word[4:] # characters from position 4 (included) to the end
|
||||
>>> word[4:] # characters from position 4 (included) to the end
|
||||
'on'
|
||||
>>> word[-2:] # characters from the second-last (included) to the end
|
||||
>>> word[-2:] # characters from the second-last (included) to the end
|
||||
'on'
|
||||
|
||||
One way to remember how slices work is to think of the indices as pointing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue