Answers for "all item in a list python"

2

how to operate on all elements in a list python

oldlist = [1,2,3]
newlist = [i * 2 for i in oldlist]
print(newlist)
# >>> [2, 4, 6]
Posted by: Guest on December-12-2020
0

find all element in list python

indices = [i for i, x in enumerate(my_list) if x == "whatever"]
Posted by: Guest on March-01-2021

Code answers related to "all item in a list python"

Python Answers by Framework

Browse Popular Code Answers by Language