Thanks to everybody that worked to clarify the meaning of [::-1].

My main concern was that it looked like the notation came out of nowhere
and, as such, was inconsistent with the usual slice notation.  The
documentation did make it clear, since the full slicing notation is
s[i:j:k], leaving out the i and j to indicate starting at the
beginning and stopping at the end results in s[::k].

The one odd thing about Python's slice notation is that the -1 means to
start from the end and work backwards.  My first inclination would have
been to assume that -1 means to start at i and go to j by steps of -1
(only nonempy if j < i).

Thanks again.

Charles Cuell
[EMAIL PROTECTED]



_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to