Issue #16225: Add additional note to tutorial about changing sequence while looping.
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index 12b5c57..e008dd8 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -584,6 +584,19 @@
orange
pear
+To change a sequence you are iterating over while inside the loop (for
+example to duplicate certain items), it is recommended that you first make
+a copy. Looping over a sequence does not implicitly make a copy. The slice
+notation makes this especially convenient::
+
+ >>> words = ['cat', 'window', 'defenestrate']
+ >>> for w in words[:]: # Loop over a slice copy of the entire list.
+ ... if len(w) > 6:
+ ... words.insert(0, w)
+ ...
+ >>> words
+ ['defenestrate', 'cat', 'window', 'defenestrate']
+
.. _tut-conditions: