What use for reversed()?

cheshire supportNOSPAM at microsoft.com
Sun May 31 17:26:08 EDT 2015


On Sun, 31 May 2015 12:40:19 -0700 (PDT), fl wrote:

> 2. If reversed() is wrong the my purpose, what method can do it? i.e. '4321'
> out.

Try using slices:

>>> b='1234'
>>> b[::-1]
'4321'

https://docs.python.org/2/whatsnew/2.3.html#extended-slices



More information about the Python-list mailing list