mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 10:01:38 +00:00
Merge pull request #2034 from louis9171/master
[Python 3] Fixed erroneous outputs stated in comments
This commit is contained in:
commit
099d5e1a6c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user