Merging lists has made my brain hurt.

Mark McEahern marklists at mceahern.com
Wed Oct 2 12:31:58 EDT 2002


> I want to merge the three lists into a single list that only contains 
> the strings present in all three lists. In the above case I want to end 
> up with
> ['ccc']

Python 2.3 will include a set type:

  http://www.python.org/dev/doc/devel/whatsnew/intro.html

In the meantime, try this recipe:

  http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/138982

// m




More information about the Python-list mailing list