get all indices in list python code example Example: get all indices of a value in list python indices = [i for i, x in enumerate(my_list) if x == "whatever"]