finding the intersection of a list of Sets
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

finding the intersection of a list of Sets

From: Suresh Jeevanandam <jm.suresh@gmail.com>
Date: Tue Jan 31 2006 - 10:36:42 CET

I have a list of sets in variable lsets .

Now I want to find the intersection of all the sets.

r = lsets[0]
for s in r[0:]:
    r = r & s

Is there any other shorter way?

Thanks in advance,
Suresh
Received on Tue Feb 7 20:19:26 2006