title: Iterate individual elements in python sets
body: <p>Given m <strong>sets</strong> of integers that have n elements.</p>
  
  <p>I have the below code, which outputs the element which occurs maximum number of times.</p>
  
  <pre><code>def find_element_which_appeared_in_max_sets(input_set):
  
      hash_table = {}
  
      # count the frequencies
      for pair in input_set:
          for i in range(0,len(pair)):
              if pair[i] in hash_table:
                  hash_table[pair[i]] = hash_table[pair[i]] + 1
              else:
                  hash_table[pair[i]] = 1 # first occurence
  
      # scan and find the element with highest frequency.
      max_freq = 0
      for elem in hash_table:
  
          if hash_table[elem] &gt; max_freq:
              max_freq = hash_table[elem]
              max_occured_elem = elem
  
      return max_occured_elem
  
  
  input_set = {(5,4),(3,2),(4,3),(8,3)}
  print ""+str(find_element_which_appeared_in_max_sets(input_set))
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>3
  </code></pre>
  
  <p>Is there a <strong>more neater/elegant way</strong> of iterating through individual elements of the set?</p>