mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-27 07:33:57 +00:00
Merge pull request #3022 from aswinsanakan/patch-1
[python3/en] Fix omitting in list and clarified comments
This commit is contained in:
commit
51b591a329
@ -209,9 +209,9 @@ li[4] # Raises an IndexError
|
|||||||
# The start index is included, the end index is not
|
# The start index is included, the end index is not
|
||||||
# (It's a closed/open range for you mathy types.)
|
# (It's a closed/open range for you mathy types.)
|
||||||
li[1:3] # => [2, 4]
|
li[1:3] # => [2, 4]
|
||||||
# Omit the end
|
# Omit the beginning and return the list
|
||||||
li[2:] # => [4, 3]
|
li[2:] # => [4, 3]
|
||||||
# Omit the beginning
|
# Omit the end and return the list
|
||||||
li[:3] # => [1, 2, 4]
|
li[:3] # => [1, 2, 4]
|
||||||
# Select every second entry
|
# Select every second entry
|
||||||
li[::2] # =>[1, 4]
|
li[::2] # =>[1, 4]
|
||||||
|
Loading…
Reference in New Issue
Block a user