Is there a Python module that already does this?

MDK mdk at mdk.com
Wed Feb 6 09:23:32 EST 2002


"Chris Gonnerman" <chris.gonnerman at newcenturycomputers.net> wrote in message
news:mailman.1013003651.8981.python-list at python.org...
> ----- Original Message -----
> From: "MDK" <mdk at mdk.com>
>
>
> > I need to convert a list into a list of characters.
> >
> > For example:
> >
> > ("cat",5,['dog',[3,3,1]],"zoo")
>
> That's not a "list", it's a tuple containing strings, ints, and lists;
> further, you have nested lists.  Ouch.
>
> > Would become:
> >
> > ('c','a','t',5,'d','o','g',3,3,1,'z','o','o')
> >
> > Any information would be appreciated.
>
> This is doable, but there is no Python builtin I am aware of that can
> do it.  Why do you need to do this?  If we understand what you are trying
> to do, we may be able to steer you away from this mess.
>
>
P.S   Sorry, I used the wrong symbols.  I meant
["cat",5,['dog',[3,3,1]],"zoo"].






More information about the Python-list mailing list