Mistake in "print to_five[:2]" example


#1



In the example below why does it not print "['A', 'B', 'C']"? If substituting default values in the example results in "print to_five[0:2:1]" this would be characters 0, 1 and 2 with a cadence of 1.


print to_five[:2]
# prints ['A', 'B']


#2

No, two is not included. All values lower/lesser then 2 are. 2 itself is not included. Just like range(5) doesn't include 5. (0,1,2,3,4)


#3

Thanks! I went back a page and it does indeed state that end is exclusive. I'm really appreciating, when compared to other programming languages, how consistent Python is in that respect.