Answers for "delete all instances in 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 "delete all instances in a list"

Python Answers by Framework

Browse Popular Code Answers by Language