[Tutor] Best way to convert list of ints to a string?
Kent Johnson
kent37 at tds.net
Sat Apr 26 05:28:03 CEST 2008
Dick Moores wrote:
> I have the feeling that I've either forgotten (or never knew) some basic
> Python built-in or something, but in case I haven't, what's the best way
> to convert a list of integers to a string?
I dunno about 'best', but here is one way to do it:
''.join(map(str, intList))
Perhaps faster using iterator.imap() instead of map().
Kent
More information about the Tutor
mailing list