summaryrefslogtreecommitdiffhomepage
path: root/python3.html.markdown
diff options
context:
space:
mode:
authorSpurlow <Spurlow@users.noreply.github.com>2015-11-27 11:39:42 +0700
committerSpurlow <Spurlow@users.noreply.github.com>2015-11-27 11:39:42 +0700
commit099d5e1a6c78347b07010d7784f0d95fa4ff0e12 (patch)
tree752511e19ef35ec7f04ce714de51294b33f0d160 /python3.html.markdown
parent812fa4bab4f784df75de4ddd1c4c67eb214b2f88 (diff)
parent69e1ee4ad0a90a05253897bb4252de85111fa22c (diff)
Merge pull request #2034 from louis9171/master
[Python 3] Fixed erroneous outputs stated in comments
Diffstat (limited to 'python3.html.markdown')
-rw-r--r--python3.html.markdown5
1 files changed, 2 insertions, 3 deletions
diff --git a/python3.html.markdown b/python3.html.markdown
index 1f9d0e42..8cc03320 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -224,8 +224,8 @@ li.remove(2) # Raises a ValueError as 2 is not in the list
# Insert an element at a specific index
li.insert(1, 2) # li is now [1, 2, 3] again
-# Get the index of the first item found
-li.index(2) # => 3
+# Get the index of the first item found matching the argument
+li.index(2) # => 1
li.index(4) # Raises a ValueError as 4 is not in the list
# You can add lists
@@ -425,7 +425,6 @@ by step. If step is not indicated, the default value is 1.
prints:
4
6
- 8
"""
for i in range(4, 8, 2):
print(i)