title: Search and sort through dictionary in Python
body: <p>I need to sort and search through a dictionary. I know that dictionary cannot be sorted. But all I need to do search through it in a sorted format. The dictionary itself is not needed to be sorted. </p>
  
  <p>There are 2 values. A string, which is a key and associated with the key is an integer value. I need to get a sorted representation based on the integer. I can get that with OrderedDict. </p>
  
  <p>But instead of the whole dictionary I need to print just the top 50 values. And I need to extract some of the keys using RegEx. Say all the keys starting with 'a' and of 5 length. </p>
  
  <p>On a side note can someone tell me how to print in a good format in python? Like: </p>
  
  <pre><code>{'secondly': 2, 
  'pardon': 6, 
  'saves': 1, 
  'knelt': 1}
  </code></pre>
  
  <p>insdead of a single line. Thank you for your time.</p>