Answers for "python access all index in list"

7

get all index of item in list python

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

access list index python

list1 = ['physics', 'chemistry', 1997, 2000];
list2 = [1, 2, 3, 4, 5, 6, 7 ];
print "list1[0]: ", list1[0]
print "list2[1:5]: ", list2[1:5]
Posted by: Guest on April-13-2022

Code answers related to "python access all index in list"

Python Answers by Framework

Browse Popular Code Answers by Language