On Mon, Nov 24, 2014 at 12:32 PM, boB Stepp robertvst...@gmail.com wrote:
Python 2.7.8
Win7Pro
str = 0123456789
str[-1]
'9'
str[-3:-1]
'78'
str[-3:]
'789'
I understand that the above is the way it is in Python, but I am
puzzled why the designers did not choose that str[-3:-1] returns
On Mon, Nov 24, 2014 at 12:57 PM, Zachary Ware
zachary.ware+py...@gmail.com wrote:
[...]
Have I clarified or muddied it for you? :)
Clarified, I believe, if my following statements are correct: I did
not consider that the behavior was symmetric with positive indices.
So, index 0 is the center
On Mon, Nov 24, 2014 at 1:06 PM, boB Stepp robertvst...@gmail.com wrote:
On Mon, Nov 24, 2014 at 12:57 PM, Zachary Ware
zachary.ware+py...@gmail.com wrote:
[...]
Have I clarified or muddied it for you? :)
Clarified, I believe, if my following statements are correct: I did
not consider that
On Mon, Nov 24, 2014 at 1:06 PM, boB Stepp robertvst...@gmail.com wrote:
On Mon, Nov 24, 2014 at 12:57 PM, Zachary Ware
zachary.ware+py...@gmail.com wrote:
[...]
Have I clarified or muddied it for you? :)
Clarified, I believe, if my following statements are correct: I did
not consider that
On Mon, Nov 24, 2014 at 12:32:27PM -0600, boB Stepp wrote:
Python 2.7.8
Win7Pro
str = 0123456789
str[-1]
'9'
str[-3:-1]
'78'
str[-3:]
'789'
I understand that the above is the way it is in Python, but I am
puzzled why the designers did not choose that str[-3:-1] returns
'789',
On Mon, Nov 24, 2014 at 1:33 PM, Zachary Ware
zachary.ware+py...@gmail.com wrote:
Also note that there's no way to get the last member with a negative
second index.
Also note that, given a -1 step, there's no way to get the first
member with a non-negative second index.
s[-1:0:-1]