DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
Split a list based on a condition
good = [x for x in mylist if x in goodvals] bad = [x for x in mylist if x not in goodvals]
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#Split
#list
#based
#condition
ADD COMMENT
Topic
COMMENT
Name
8+6 =
Submit