invert or reverse a string... warning this is a rant
jstroud at mbi.ucla.edu
Thu Oct 19 20:54:22 CEST 2006
Paul Boddie wrote:
> James Stroud wrote:
> I guess Python 2.5 has the reversed method of which you speak.
Not that I could find (as methods of any built in sequence type). 2.5
just has the "reversed" function that returns and iterator and so 2.5
requires these kind of gymnastics on built in sequences:
Of course, I think str.join can operate on iterators, as Paul Rubin
> print ''.join(reversed(x))
This latter approach still seems a little clunky, though.
UCLA-DOE Institute for Genomics and Proteomics
Los Angeles, CA 90095
More information about the Python-list