python for loop

Hrvoje Niksic hniksic at xemacs.org
Wed Apr 1 01:48:45 EDT 2009


Chris Rebert <clp2 at rebertia.com> 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