Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python list iterate in 1 line

mylist = [1,4,5,8,9,11,13,12]

newlist = [x for x in mylist if x%2 == 1]
print(newlist)
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #python #list #iterate #line
ADD COMMENT
Topic
Name
8+3 =