Python List and remove a variable
<p>I am new to programming. I was trying to understand different data structure in python. In List i was trying:</p>

<pre><code>mylist = [1,2,1,2,1,2,3,4,5,1,2,3]
print mylist
mylist.remove(2)
print mylist
</code></pre>

<p>It is supposed to remove 2 from the list. It does but the first one only.
The output is like:</p>

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

<p>How can i remove all the match ?</p>