I've got the list `student`:

```
student = ["test_name","1","6"]

```

And I've got the `read data` sublist:

```
read_data = [["test_name","1","2","5","9"],["test_name_2","1","5","2","10"]]

```

I've written the following nested loop to return the index of a sublist (referred to as `x`) in `read_data` if `student[0] == x[0]`:

```
lst = [read_data.index(x) for x in read_data if x[0] == student [0]]

```

So I'm looping through each item in read data and (if `x[0] == student[0]`) the index of the sublist should be stored in `lst`.

When I try to use this in the index parameter of a list to insert data like so:

```
read_data[read_data.index(x) for x in read_data if x[0] == student[0]].insert(2,student[0])

```

I get an error saying generators can't be used for indexes - why not?
I can obviously just use the integer stored in `lst` but this seems inefficient - surely there's a way to do this on one line.

Is there some better alternative method to checking if a string is in any of a `read_data`'s sublists and getting the index of this sublist?