i= set([5,3,1]) # <-- 'Master' Setz= [set([5,0,4]), set([2,9,8])]newlist = [x for x in z if x.intersection(i)]print newlist # your code goes here
Standard input is empty
[set([0, 4, 5])]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!