diff options
author | Elijah Karari <eljhkrr@gmail.com> | 2015-10-31 09:47:55 +0300 |
---|---|---|
committer | Elijah Karari <eljhkrr@gmail.com> | 2015-10-31 09:47:55 +0300 |
commit | 5bda926dcc79dea4e936cc752fd1ff00e29d71bb (patch) | |
tree | af18c44d745199dd5c79acc6c79987e8674c7420 /python.html.markdown | |
parent | edfc99e198fd2e87802ea81d6779fbadfab64919 (diff) |
Minor correction
calling li.index(2) with li as [1, 2, 3, 4, 5, 6] will return 1 not 3
Diffstat (limited to 'python.html.markdown')
-rw-r--r-- | python.html.markdown | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python.html.markdown b/python.html.markdown index 541bd36d..80cef828 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -238,7 +238,7 @@ li.remove(2) # Raises a ValueError as 2 is not in the list li.insert(1, 2) # li is now [1, 2, 3, 4, 5, 6] again # Get the index of the first item found -li.index(2) # => 3 +li.index(2) # => 1 li.index(7) # Raises a ValueError as 7 is not in the list # Check for existence in a list with "in" |