Function/method returning list of chars in string?

Chris Rebert clp2 at rebertia.com
Tue Jun 9 03:32:46 EDT 2009


On Tue, Jun 9, 2009 at 12:25 AM, Hendrik van Rooyen<mail at microcorp.co.za> wrote:
> One can go from lb = ['b','a','n','a','n','a']
> to s = "banana" by using s = "".join(lb)
>
> Is there a way to go the reverse route?

lb = list("banana")

Cheers,
Chris
-- 
http://blog.rebertia.com



More information about the Python-list mailing list