I have a list of lists:

```
lists=[[1.2,0], [4.5,0], [2.1,1], [6.5,0], [3.4,1]]

```

I want to put all the elements that have 0 together in one list, and all the 1 in another list, so it would look like this:

```
res1=[2.1, 3.4]
res0=[1.2, 4.5, 6.5]

```

I have tried the following, but it does not seem to work:

```
for a in lists:
  for b in lists:
    if b ==0:
    res1.append(lists[1])
    else:
     res2.append(lists[2])

```

I am new to python, and I have tried searching online, but I am unable to find a result. Any help would be appreciated. Thank you!