How sort a dict using the values of a list inside (two sequential criteria)
<p>I need to sort this dict with two sequential criteria: "rank" descending, "fruit" ascending (in case of same ranking result).</p>

<p>The dict is structured in this way</p>

<pre><code>'object':['fruit',rank]
</code></pre>

<p>For example I've:</p>

<pre><code>myDict = {'item2': ['bananas', 3], 'item3': ['cocumbers', 11], 'item1': ['pinapples', 3], 'item4': ['pears', 3]}
</code></pre>

<p>My aim is to obtain this:</p>

<pre><code>{'item3': ['cocumbers', 11], 'item2': ['bananas', 3],'item4': ['pears', 3], 'item1': ['pinapples', 3]}
</code></pre>

<p>with </p>

<pre><code>sorted(myDict.items(), key=lambda (k, v): v[1], reverse=True)
</code></pre>

<p>I obtain only the correct sorting for rank but with no sorting order for the objects with the same ranking:</p>

<pre><code>[('item3', ['cocumbers', 11]), ('item2', ['bananas', 3]), ('item1', ['pinapples', 3]), ('item4', ['pears', 3])]
</code></pre>

<p>How solve this in python 2.7? </p>

<p>Thank's</p>
