I am new to programming. I was trying to understand different data structure in python. In List i was trying:
mylist = [1,2,1,2,1,2,3,4,5,1,2,3]
print mylist
mylist.remove(2)
print mylist
It is supposed to remove 2 from the list. It does but the first one only. The output is like:
[1, 2, 1, 2, 1, 2, 3, 4, 5, 1, 2, 3]
[1, 1, 2, 1, 2, 3, 4, 5, 1, 2, 3]
How can i remove all the match ?