list_values = ['A', 'B', 'A', 'C', 'E'] def indices(lst, item): return [i for i, x in enumerate(lst) if x == item] ind_A = indices(list_values, "A") print(ind_A) # [0,2]