Obtenez tous les indices d'occurrence dans la liste Python

a_list = [1, 2, 3, 1]
indices = [index for index, element in enumerate(a_list) if element == 1]
GaL