Concatenating a list of lists

Neophytos Michael nmichael at yahoo.com
Sat Aug 17 22:17:19 CEST 2002


A quick question for the python experts.  I have a list of lists (only
one level) that I want to turn into a flat list.  What's the python
way of achieving this?  I came up with:

def red_aux(l1, l2):
    l1.extend(l2);
    return l1;

dest_list = reduce(red_aux, src_list, []);

Thanks,
Neophytos



More information about the Python-list mailing list