python for loop

Hrvoje Niksic hniksic at
Wed Apr 1 07:48:45 CEST 2009

Chris Rebert <clp2 at> writes:

> Among other things, it has the nice property that:
> len(some_list[n:m]) == m-n

And also that it is intuitive how to represent an empty slice
(foo[n:n]).  When traversing over sublists, it's also a useful
property that foo[a:b] + foo[b:c] == foo.

More information about the Python-list mailing list