mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-07 23:37:32 +02:00
Merge pull request #1 from louis9171/louis9171-python3
Fixed erroneous output and added a little clarity on the matter
This commit is contained in:
@@ -224,8 +224,8 @@ li.remove(2) # Raises a ValueError as 2 is not in the list
|
|||||||
# Insert an element at a specific index
|
# Insert an element at a specific index
|
||||||
li.insert(1, 2) # li is now [1, 2, 3] again
|
li.insert(1, 2) # li is now [1, 2, 3] again
|
||||||
|
|
||||||
# Get the index of the first item found
|
# Get the index of the first item found matching the argument
|
||||||
li.index(2) # => 3
|
li.index(2) # => 1
|
||||||
li.index(4) # Raises a ValueError as 4 is not in the list
|
li.index(4) # Raises a ValueError as 4 is not in the list
|
||||||
|
|
||||||
# You can add lists
|
# You can add lists
|
||||||
|
Reference in New Issue
Block a user