Reverse "omit the beginning|end"

While reading I thought this might be a mistake (or I'm just going crazy).
This commit is contained in:
Jeff Carpenter 2013-06-28 17:11:32 -07:00
parent 3301f77062
commit e2fe947b79

View File

@ -134,9 +134,9 @@ except IndexError:
# (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 beginning # Omit the beginning
li[:3] #=> [1, 2, 4]
# Omit the end
li[2:] #=> [4, 3] li[2:] #=> [4, 3]
# Omit the end
li[:3] #=> [1, 2, 4]
# Remove arbitrary elements from a list with del # Remove arbitrary elements from a list with del
del li[2] # li is now [1, 2, 3] del li[2] # li is now [1, 2, 3]