Python Love :)

Kent Johnson kent at kentsjohnson.com
Mon Mar 13 19:46:05 CET 2006


Paul Rubin wrote:
> So what's the most concise way
> of turning it back into a string?  ''.join(list(reversed(a_string))) ?

You don't need the list(), join() can take an iterator:

''.join(reversed(a_string))

Kent



More information about the Python-list mailing list