title: python dict, find value closest to x
body: <p>say I have a dict like this :</p>
  
  <pre><code>d = {'a': 8.25, 'c': 2.87, 'b': 1.28, 'e': 12.49}
  </code></pre>
  
  <p>and I have a value </p>
  
  <pre><code>v = 3.19
  </code></pre>
  
  <p>I want to say something like :</p>
  
  <pre><code>x = "the key with the value CLOSEST to v"
  </code></pre>
  
  <p>Which would result in </p>
  
  <pre><code>x = 'c'
  </code></pre>
  
  <p>Any hints on how to approach this?</p>