Answers for "python list for loop one line"

2

making lists with loops in one line python

print([i for i in range(10)])
Posted by: Guest on June-25-2020
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

Code answers related to "python list for loop one line"

Python Answers by Framework

Browse Popular Code Answers by Language