title: How to get position of key in a dictionary in python
body: <p>If a key is present in a dictionary, I want to know what position the key is in i.e the numerical index. For example : </p>
  
  <p>if the dictionary consists of : </p>
  
  <pre><code>{'test':{1,3},'test2':{2},'test3':{2,3}}
  
  if 'test' in dictionary:
     print(the index of that key)
  </code></pre>
  
  <p>The output would be 0 for example. (The output would be 2 for 'test3'...)</p>
  
  <p>I'm using a dictionary at the moment, I'm guessing I'd have to use an ordered <code>dict</code> to do this, but how can I do it using an ordered <code>dict</code> ?</p>
  
  <p>Thanks for any help.</p>