Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pythonremove all instances from a list

l = [0, 1, 0, 0, 1, 0, 1, 1]
val = 0
 
try:
	while True:
    	l.remove(val)
except ValueError:
	pass
Source by www.techiedelight.com #
 
PREVIOUS NEXT
Tagged: #pythonremove #instances #list
ADD COMMENT
Topic
Name
8+2 =