Answers for "python how remove all instances of a word ina 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 "python how remove all instances of a word ina list"

Python Answers by Framework

Browse Popular Code Answers by Language