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', especially since str[-1] returns '9'. What is the reason for
choosing Python's actual behavior?

-- 
boB
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to