Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove list of value from list python

# Python program to remove multiple
# elements from a list
 
# creating a list
list1 = [11, 5, 17, 18, 23, 50]
 
# given index of elements
# removes 11, 18, 23
unwanted = [0, 3, 4]
 
for ele in sorted(unwanted, reverse = True):
    del list1[ele]
 
# printing modified list
print (*list1)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #remove #list #list #python
ADD COMMENT
Topic
Name
1+5 =