Fix omitting in list and clarified comments

This commit is contained in:
Aswin Sanakan 2017-12-05 12:24:43 +05:30 committed by GitHub
parent 990f51293b
commit 3386171160
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -209,9 +209,9 @@ li[4] # Raises an IndexError
# The start index is included, the end index is not
# (It's a closed/open range for you mathy types.)
li[1:3] # => [2, 4]
# Omit the end
# Omit the beginning and return the list
li[2:] # => [4, 3]
# Omit the beginning
# Omit the end and return the list
li[:3] # => [1, 2, 4]
# Select every second entry
li[::2] # =>[1, 4]