title: Removing elements from an array in python
body: <p>Consider the array <code>a= [1, 2, 3, 1, 2, 3]</code>. Now suppose I want to remove all the 2s in this array in python. So I apply <code>a.remove(2)</code>. However the result which comes out is <code>[1, 3, 1, 2, 3]</code>, i.e the only first 2 is removed. How can I remove all the 2s which appear in an array? In general, given an array and an element p, how can I remove all the elements of the array which are equal to p?            </p>
  
  <p>Edit:- I think I should mention this, this question has been inspired from a Brilliant computer science problem.</p>