Answers for "pythonremove all instances from a list"

0

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
Posted by: Guest on May-29-2021

Code answers related to "pythonremove all instances from a list"

Python Answers by Framework

Browse Popular Code Answers by Language