Sorting a dictionary which has values as list, and sorting based on the elements inside this list
<p>I have a list</p>

<pre><code>A={'k3': ['b', 3],'k2': ['a', 1],'k1': ['a', 3],'k4': ['c', 2],'k5': ['b', 2]}
</code></pre>

<p>I want to sort the above dictionary first by letters 'a','b' and 'c' in an ascending order</p>

<p>and then based on values 3,2,1 in the descending order. So my output should look something like</p>

<pre><code>A={'k1': ['a', 3],'k2': ['a', 1],'k3': ['b', 3],'k5': ['b', 2],'k4': ['c', 2]}
</code></pre>

<p>How do I do it?</p>
