Answers for "delete element from list python list"

2

delete element of a list from another list python

l1 = ["a", "b", "c", "d", "e", "f"]
l2 = ["b", "c", "e"]

l1 = [elt for elt in l1 if elt not in l2]
# l1 = ['a', 'd', 'f']
Posted by: Guest on April-02-2021
12

python how to remove item from list

list.remove(item)
Posted by: Guest on April-12-2020

Code answers related to "delete element from list python list"

Python Answers by Framework

Browse Popular Code Answers by Language