How to write a function to rearrange a list according to the dictionary of index
<p>How to write a function to rearrange a list according to the dictionary of index in python?</p>

<p>for example,</p>

<pre><code>    L=[('b',3),('a',2),('c',1)]

    dict_index={'a':0,'b':1,'c':2}
</code></pre>

<p>I want a list of :</p>

<pre><code>   [2,3,1]
</code></pre>

<p>where 2 is from 'a',3 is from 'b' and 1 is from 'c', but rearrange only the number in L according to the dict_index</p>
