pythonremove all instances from a list

Solutions on MaxInterview for pythonremove all instances from a list by the best coders in the world

showing results for - "pythonremove all instances from a list"
Miranda
08 Nov 2019
1l = [0, 1, 0, 0, 1, 0, 1, 1]
2val = 0
3 
4try:
5	while True:
6    	l.remove(val)
7except ValueError:
8	pass