[docs] string reverse

Sandro Tosi sandro.tosi at gmail.com
Sat Mar 31 22:31:34 CEST 2012


Hello Chris,

On Wed, Mar 21, 2012 at 19:25, Chris Kogelnik <kogelnik at gmail.com> wrote:
> Hi,
>
> There is no string reverse method in Python, but there is an easy way to do
> it using negative stepping in the extended slice syntax, ie.
> some_string[::-1].  Since this is somewhat non-intuitive, I think adding a
> note to the String Methods section under Built-in Types will spare a lot of
> people the time of implementing such a method.

It is already mentioned at:
http://docs.python.org/faq/programming.html#how-do-i-iterate-over-a-sequence-in-reverse-order

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


More information about the docs mailing list