[Tutor] What exactly is [::-1]?

Alan Gauld alan.gauld at btinternet.com
Thu Jul 26 09:17:24 CEST 2007

"Dick Moores" <rdm at rcblue.com> wrote

>>I could send you a link but I'd just google 'python list slicing' to
>>find it, so I'll leave that as an exercise for the reader.
> I don't find Google of help with this. Could someone supply a link?

Not sure why it didn't help you Dick, but it led me to:


Which is admittedly sparing in its explanation but does at
least describe the three values involved and their defaults.

The tutorial also threw up this:


Which describes basic slicing (using only 2 indices) of strings
and also has a link to the previous reference page.

Finally I tried googling for 'python slicing' and got this as my first 


Which is the language lawyers version!


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list