I get a list like that [[3,5],[5,3],[5,4],[0,2],[1,4],[1,2]]
So I want to delete [5,4]
and [1,2]
because list has same first of number [5,3]
and [1,4]
so I tried
- append the small list
- reverse the list
- remove the list
but I don't know how can access [5,4] and [1,2]
>>> a=[[3,5],[5,3],[5,4],[0,2],[1,4],[1,2]]
>>> a.reverse()
>>> a.remove()
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: remove() takes exactly one argument (0 given)
>>> a.remove(5)
Traceback (most recent call last):
File "<input>", line 1, in <module>
ValueError: list.remove(x): x not in list