Trouble Comparing Elements of Sets (Python)?
<p>I'm working on a program in which I need to check each element of a set (from a list of sets) and compare it against a 'master' set and then append the set to a list if at least a single element of the two sets match. </p>

<p>I tried attacking this problem like a list only to realize that indexing doesn't work on sets. </p>

<p>Ex of what I'm trying to accomplish:</p>

<pre><code>newlist = []
i = set([5, 3, 1]) # &lt;-- 'Master' Set
z = set([5, 0, 4])

#Output should be -&gt; newlist = [set([5,0,4])]
</code></pre>