title: Find Symmetric pairs in python
body: <p>I have the below code to find and print all symmetric pairs from given input.</p>
  
  <pre><code>'''
   Given a list of number pairs.
   If pair(i,j) exist, and pair(j,i) exist report all such pairs.
  '''
  
  def find_all_symmetric_pairs(inp_dic):
  
      for key in inp_dic:
          val = inp_dic[key]
  
          if inp_dic[val] == key:
              return key,val
      return -1,-1
  
  
  inp_dic = {'1':'3','2':'6','3':'5','7':'4','5':'3','8':'7'}
  
  print type(inp_dic)
  key,value = find_all_symmetric_pairs(inp_dic)
  
  print "key:"+str(key)
  print "value:"+str(value)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code> key:3
   value:5
  </code></pre>
  
  <p>But if I change the input to </p>
  
  <pre><code>inp_dic = {(1,3),(2,6),(3,5),(7,4),(5,3),(8,7)}
  </code></pre>
  
  <p>or</p>
  
  <pre><code>inp_dic = {{1,3},{2,6},{3,5},{7,4},{5,3},{8,7}}
  </code></pre>
  
  <p>I have difficulty iterating. How do I achieve the same?</p>