#!/usr/bin/env python2.7 setA = {'eclass'} listB = ['eclass', 'profiles', 'metadata', 'otherA', 'otherB'] listC = ['profiles', 'metadata', 'otherA', 'otherB'] if setA & frozenset(listB): print("setA is an intersection of listB") if setA & frozenset(listC): print("setA is an intersect of listC") else: print("setA is NOT an intersect of listC")