In Python remove() will remove the first occurrence of value in a list.
remove()
How to remove all occurrences of a value from a list?
This is w
See the simple solution
>>> [i for i in x if i != 2]
This will return a list having all elements of x without 2
x
2