単純にforで
ans = [] for index, value in enumerate(a): if value == 3: ans.append(index)
内包表記で
ans = [ i for i, v in enumerate(a) if v == 3]