a question about s[i:j] when i is negative

dracula571 dracula571 at gmail.com
Tue Oct 17 04:26:53 EDT 2006


Fredrik Lundh 写道:

> dracula571 wrote:
>
> > but k[-6:2] = [1,2]
> > why k[-6:2] is [1,2]not [].i do follow (3),to make i positive by
> > plusing len(k) twice.
> 
> twice?
> 
> </F>
that is -6 + len(k) + len(k) =4




More information about the Python-list mailing list