title: Random Max Key in dictionary in case of tie
body: <p>I have a <code>dictionary</code>: keys are strings, values are float.</p>
  
  <p>Example: </p>
  
  <pre><code>A = {'a':1, 'b':2, 'c':2, 'd':0}
  </code></pre>
  
  <p>I'd like to get <code>'b'</code> or <code>'c'</code> as answer with equal probability. I found a way to get said behaviour. However I'm not convinced this is best practice.</p>
  
  <pre><code>import random
  
  A = {'a':1, 'b':2, 'c':2, 'd':0}
  all = (A.items())
  values = [(x[1],random.random(),x[0]) for x in all]
  maxIndex = values.index(max(values))
  print(values[maxIndex][2])
  </code></pre>
  
  <p>Is there a better (or even more elegant) approach?</p>