summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/tutorial')
-rw-r--r--Doc/tutorial/introduction.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/tutorial/introduction.rst b/Doc/tutorial/introduction.rst
index 97065af..f6339a7 100644
--- a/Doc/tutorial/introduction.rst
+++ b/Doc/tutorial/introduction.rst
@@ -482,6 +482,12 @@ concatenated and so on::
>>> 3*a[:3] + ['Boo!']
['spam', 'eggs', 100, 'spam', 'eggs', 100, 'spam', 'eggs', 100, 'Boo!']
+All slice operations return a new list containing the requested elements. This
+means that the following slice returns a shallow copy of the list *a*::
+
+ >>> a[:]
+ ['spam', 'eggs', 100, 1234]
+
Unlike strings, which are *immutable*, it is possible to change individual
elements of a list::