Why Python does *SLICING* the way it does??

James Stroud jstroud at mbi.ucla.edu
Wed Apr 20 13:50:54 EDT 2005


On Tuesday 19 April 2005 10:58 pm, seberino at spawar.navy.mil wrote:
> Many people I know ask why Python does slicing the way it does.....
>
> Can anyone /please/ give me a good defense/justification???

Here you go, no remembering "+1" or "-1". Also, see the hundreds of other 
times this topic has graced this list.

>>> i = 4
>>> str = "asdfjkl;"
>>> print str[:i]+str[i:]
asdfjkl;

James

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/



More information about the Python-list mailing list