get all indices of a value in list python

39

indices = [i for i, x in enumerate(my_list) if x == "whatever"]

Comments

Submit
0 Comments