title: In the case of a tie, how do I return the largest and most frequent number in python?
body: <p>I have a list of numbers. I created this frequency dictionary d:</p>
  
  <pre><code>from collections import Counter
  mylist = [10, 8, 12, 7, 8, 8, 6, 4, 10, 12, 10, 12]
  d = Counter(mylist)
  print(d)
  </code></pre>
  
  <p>The output is like this:</p>
  
  <pre><code>Counter({10: 3, 8: 3, 12: 3, 7: 1, 6: 1, 4: 1})
  </code></pre>
  
  <p>I know I can use <strong>max(d, key=d.get)</strong> to get value if there is no tie in frequency. If multiple items are maximal, the function usually returns the first one encountered. How can I return the largest number, in this case, 12, instead of 10?  Thank you for your help!</p>