Obtenga todos los índices de un valor en la lista Python
indices = [i for i, x in enumerate(my_list) if x == "whatever"]
Shaunak
indices = [i for i, x in enumerate(my_list) if x == "whatever"]
def find(s, ch):
return [i for i, ltr in enumerate(s) if ltr == ch]