Python Love :)

Kent Johnson kent at kentsjohnson.com
Mon Mar 13 13:46:05 EST 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