Answers for "python list iterate in 1 line"

0

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)
Posted by: Guest on October-30-2021

Python Answers by Framework

Browse Popular Code Answers by Language