diff options
author | Rinoc Johnson <rinoc.johnson@gmail.com> | 2015-04-30 19:31:38 -0400 |
---|---|---|
committer | Rinoc Johnson <rinoc.johnson@gmail.com> | 2015-04-30 19:31:38 -0400 |
commit | 5ebe2dcb6eeaf7e34daf07f76dcfa2403f05a332 (patch) | |
tree | 2d3c1a13e5e0c349c234fa832f9052351f055614 | |
parent | e13e00945dc4bb20c7cf6b9cd4af87f73b965ddb (diff) |
Clarify wording for list reversal.
-rw-r--r-- | python.html.markdown | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python.html.markdown b/python.html.markdown index f081a6a7..ace3f794 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -191,14 +191,14 @@ li[2:] # => [4, 3] li[:3] # => [1, 2, 4] # Select every second entry li[::2] # =>[1, 4] -# Reverse the list +# Reverse a copy of the list li[::-1] # => [3, 4, 2, 1] # Use any combination of these to make advanced slices # li[start:end:step] # Remove arbitrary elements from a list with "del" del li[2] # li is now [1, 2, 3] - +r # You can add lists li + other_li # => [1, 2, 3, 4, 5, 6] # Note: values for li and for other_li are not modified. |