DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python remove many items via index at oncefrom a list?
reduced_list = [elem for elem in my_list if my_list.index(elem) in indexes_to_keep_list]
PREVIOUS
NEXT
Tagged:
#python
#remove
#items
#index
#oncefrom
ADD COMMENT
Topic
COMMENT
Name
9+4 =
Submit