mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Correct typos in Ping's email address.
Remove premature use of negative indexes in string operation examples; negative indexes have not been explained at that point, and the use of negative indexes are not necessary for the examples.
This commit is contained in:
parent
990b0fec1a
commit
67fdaa4883
1 changed files with 4 additions and 4 deletions
|
@ -620,7 +620,7 @@ indexed position in the string results in an error:
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
File "<stdin>", line 1, in ?
|
File "<stdin>", line 1, in ?
|
||||||
TypeError: object doesn't support item assignment
|
TypeError: object doesn't support item assignment
|
||||||
>>> word[:-1] = 'Splat'
|
>>> word[:1] = 'Splat'
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
File "<stdin>", line 1, in ?
|
File "<stdin>", line 1, in ?
|
||||||
TypeError: object doesn't support slice assignment
|
TypeError: object doesn't support slice assignment
|
||||||
|
@ -632,7 +632,7 @@ efficient:
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
>>> 'x' + word[1:]
|
>>> 'x' + word[1:]
|
||||||
'xelpA'
|
'xelpA'
|
||||||
>>> 'Splat' + word[-1:]
|
>>> 'Splat' + word[4]
|
||||||
'SplatA'
|
'SplatA'
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
|
@ -1645,7 +1645,7 @@ An example that uses most of the list methods:
|
||||||
|
|
||||||
|
|
||||||
\subsection{Using Lists as Stacks \label{lists-as-stacks}}
|
\subsection{Using Lists as Stacks \label{lists-as-stacks}}
|
||||||
\sectionauthor{Ka-Ping Yee}{ping@lfs.org}
|
\sectionauthor{Ka-Ping Yee}{ping@lfw.org}
|
||||||
|
|
||||||
The list methods make it very easy to use a list as a stack, where the
|
The list methods make it very easy to use a list as a stack, where the
|
||||||
last element added is the first element retrieved (``last-in,
|
last element added is the first element retrieved (``last-in,
|
||||||
|
@ -1673,7 +1673,7 @@ first-out''). To add an item to the top of the stack, use
|
||||||
|
|
||||||
|
|
||||||
\subsection{Using Lists as Queues \label{lists-as-queues}}
|
\subsection{Using Lists as Queues \label{lists-as-queues}}
|
||||||
\sectionauthor{Ka-Ping Yee}{ping@lfs.org}
|
\sectionauthor{Ka-Ping Yee}{ping@lfw.org}
|
||||||
|
|
||||||
You can also use a list conveniently as a queue, where the first
|
You can also use a list conveniently as a queue, where the first
|
||||||
element added is the first element retrieved (``first-in,
|
element added is the first element retrieved (``first-in,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue