Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: object doesn't support item assignment
->>> word[:-1] = 'Splat'
+>>> word[:1] = 'Splat'
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: object doesn't support slice assignment
\begin{verbatim}
>>> 'x' + word[1:]
'xelpA'
->>> 'Splat' + word[-1:]
+>>> 'Splat' + word[4]
'SplatA'
\end{verbatim}
\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
last element added is the first element retrieved (``last-in,
\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
element added is the first element retrieved (``first-in,