Using a list as a key to match to another
<p>I have 4 lists and I need to match them using the first two as a key:</p>

<pre><code>keyNumbers = [3, 2, 1, 4, 5]
keyLetters = ['E', 'D', 'C', 'B', 'A']
numbers = [3, 2, 4, 1, 5]
letters = []
</code></pre>

<p>I want it to work so that letters would be edited for
It should also work with duplicated numbers or letters</p>

<p>Expected Output: E, D, B, C, A</p>

<p>You can match the indexes</p>

<pre><code>&gt;&gt;&gt; keyNumbers = [1, 2, 3, 4, 5]
&gt;&gt;&gt; keyLetters = ['E', 'D', 'C', 'B', 'A']
&gt;&gt;&gt; numbers = [3, 2, 4, 1, 5]
&gt;&gt;&gt; letters = [keyLetters[keyNumbers.index(i)] for i in numbers]
&gt;&gt;&gt; letters
['C', 'D', 'B', 'E', 'A']
</code></pre>

python