Python removal of items after iteration
<p>Why is my code not working? I can't figure it out</p>

<pre><code>matchList = [['g', 'h', 'i'], ['a', 'b', 'c'] ... ]]
myList = []

for i in match_list:
    for j in i:
        for word in first_list:
            if j in word:
                myList.append(j)
                match_list.remove(j)
</code></pre>

<p>I am getting the error <code>ValueError: list.remove(x): x not in list</code></p>

<p>EDIT:</p>

<pre><code>first_list = ['i', 'am', 'an', 'old', 'man']
</code></pre>

<p>You want: </p>

<pre><code>i.remove(j)
</code></pre>

<p>match_list is a list of lists</p>

python