how to flatten one level of list of lists?
malcolm at commsecure.com.au
Tue May 29 20:29:06 CEST 2001
On Tue, May 29, 2001 at 01:36:12PM -0400, George Young wrote:
> I have a list like:
> l = [, , , ]
> and I want to get:
> ll = [2, 3, 5, 11]
> I know I can do something like:
> ll = map(lambda i: i,l)
> but it seems like overkill to have to use a lamba for such a simple
> Is there some easy way I'm missing?
You mention you are using Python 2.1, so list cmoprehensions to the
ll = [x for x in l]
How many of you believe in telekinesis? Raise my hand...
More information about the Python-list