title: Sort Python Dictionary by first four characters in Key
body: <p>I have a python dictionary that looks like the following:</p>
  
  <pre><code>{'666 -&gt; 999': 4388, '4000 -&gt; 4332': 4383, '1333 -&gt; 1665': 7998, '5666 -&gt; 5999': 4495, '3666 -&gt; 3999': 6267, '3000 -&gt; 3332': 9753, '6333 -&gt; 6665': 7966, '0 -&gt; 332': 877}
  </code></pre>
  
  <p>The keys are obviously all strings, but each key depicts a range of numbers. What I'd like to do is sort this dictionary based on the first number in the key. Is there a quick method for doing so? Just using sorted on the dictionary doesn't help because the string "666" is lexically greater than the string " 1000". Thanks for any suggestions</p>