Http://www.cnblogs.com/vamei/archive/2012/05/28/2522677.html
Range reference: Basic style [lower limit: Upper limit: Step length]
>>>print s1[:5] # from start to subscript 4 (elements of subscript 5 are not included)>>>print s1[2:] # from subscript 2 to final >>>print s1[0:5:2] # from subscript 0 to subscript 4 (subscript 5 not included), take one element every 2 (the element labeled 0,2,4)>>>print s1[2:0:-1] # from subscript 2 to subscript 1
As can be seen from the above, the upper limit is not included in the range reference when the upper limit is indicated.
Trailing element reference
>>>print s1[-1] # sequence last element >>>print s1[-3] # Third element of the penultimate sequence
Similarly, if s1[0:-1], then the last element will not be referenced (again, excluding the upper bound element itself)
Python notes-List slice Reference