title: Sorting a dictionary by an inner "attribute" dictionary key-value
body: <p>I created a dictionary using a for-loop and this code:</p>
  
  <pre><code>players[name] = {'roll_total': player_roll, 'ante': None}
  </code></pre>
  
  <p>Previously my dictionary was just players = {names: totals} and I could sort it using this code: </p>
  
  <pre><code>players = [(k, players[k]) for k in sorted(players, key=players.get, reverse=True)]
  </code></pre>
  
  <p>But now since I implemented the inner "attribute" dictionary, I get an error saying comparisons can't be made on dictionaries.</p>
  
  <blockquote>
    <p>TypeError: '&lt;' not supported between instances of 'dict' and 'dict'</p>
  </blockquote>
  
  <p>So how can I modify the sorting method to compare values of the dictionaries (the roll_total values), and have my players dictionary sorted?</p>