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
To remove all duplicate occurrences and leave one in the list:
test = [1, 1, 2, 3] newlist = list(set(test)) print newlist [1, 2, 3]
Here is the function I've used for Project Euler:
def removeOccurrences(e): return list(set(e))