title: How to compare two sets to each other?
body: <p>I'm currently attempting to solve &quot;Question 349 - Intersection of two arrays&quot; on leetcode and was trying to return an array of their intersection. My goal was to make two separate sets that took in the values of each array because I need unique values.</p>
  <p>I'm confused as to how I'm supposed to iterate through both sets now to return the elements that match and return that. This is my code and I'm having the issue where it tells me that <code>bool object is not iterable</code> which makes sense:</p>
  <pre><code>class Solution:
      def intersection(self, nums1: List[int], nums2: List[int]) -&gt; List[int]:
          set1 = set()
          set2 = set()
          newList = []
          for i in nums1:
              set1.add(i)
          for j in nums2:
              set2.add(j)
          for i in set1 and j in set2:
              if (set1(i) == set2(j)):
                  newList.append[i]
          return newList
  </code></pre>