title: How to change a list of tuples to a set in Python?
body: <p>I created a function in Python which returns a list of all the possible outcomes of throwing 2 dice. 
  The list of tuples: [(1,1), (1,2), ..., (6,6)]. </p>
  
  <p>Then I wrote a function to find all elements of which the sum of the two values is even <strong>(a)</strong> and another one to find the elements of which the product of the values is even <strong>(b)</strong>. </p>
  
  <p>Now I'm trying to write a function to find the elements that are only in <strong>(a)</strong> and another one to find the elements of which the product of the values is even in both <strong>(a)</strong> and <strong>(b)</strong>. </p>
  
  <blockquote>
  <pre><code>def dice_outcomes():
      outcomes=[]
      for i in range (1,7):
          for j in range (1,7):
              outcomes.append((i,j))
      r = outcomes
      return(r)
  
  def filter_sumiseven(tuple):
      elem1 = tuple[0]
      elem2 = tuple[1]
      return (elem1 + elem2)%2 == 0
  
  def filter_productiseven(tuple):
      elem1 = tuple[0]
      elem2 = tuple[1]
      return (elem1 * elem2)%2 == 0
  </code></pre>
  </blockquote>
  
  <p>I tried to convert my list (see below) to a set but it still does not work. 
  I first tried to make a variable a and b for the return of my 2nd and 3rd function but that didn't work. 
  Could anyone explain how to get the correct output? </p>
  
  <blockquote>
  <pre><code> def only_as(a):
       set_a = set(a)
       set_b = set(b)
       if set_a not in set_b: 
           return set_a 
       else: 
           #DO NOT ADD
  
  
   def a_and_b(a, b):
       set_a = set(a)
       set_b = set(b)
       if set_a in set_b:
           #print
       if set_b in set_a :
           #print 
  </code></pre>
  </blockquote>
  
  <p>Thanks a lot for your help! </p>