Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python enumerate in list comprehension with if statement

my_list = [0,1,2]
[i for i, w in enumerate((_ for _ in my_list if _ != 1)) ]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #enumerate #list #comprehension #statement
ADD COMMENT
Topic
Name
7+8 =