Reverse Iteration Through Integers

Martien Verbruggen martien.verbruggen at invalid.see.sig
Mon Oct 19 22:42:45 CEST 2009

On Sun, 18 Oct 2009 23:04:36 -0700 (PDT),
	alex23 <wuwei23 at> wrote:
> On Oct 19, 3:53 pm, Jabba Laci <jabba.l... at> wrote:
>> Would someone explain how str[::-1] work? I'm new to Python and I only
>> saw so far the str[begin:end] notation. What is the second colon?
> Slice notation is of the form [start:stop:step]. start defaults to the
> start of the sequence, stop to the end, and step to 1.
> So a slice of [::-1] returns the full sequence in reverse, stepping
> back one character at a time from the end of the sequence to the
> beginning.
> The only mention I could find was 

There's also

Martien Verbruggen           | There are only 10 types of people in
first.last at | the world; those who understand binary
                             | and those who don't.

More information about the Python-list mailing list