I have a list of lists like this one :
[[1, 'Reason', [('reason',), ('other_reason',)]], [2, 'other', [('dep',),
('path',)]], [3, "foo", [('bar',), ('bar1',)]] ]
I have this list in a function that sometimes return it as it is (an edit mode) and in (show details) mode change the last element from the last position to the first position , so the list will be like :
[ [1, "foo", [('bar',), ('bar1',)]], [2, 'other', [('dep',), ('path',)]],
[3, 'Reason', [('reason',), ('other_reason',)]]]
I want to remove the list that contains 'Reason' (the first list in the first example ).
I tried using list.index('Reason') method to have index but it is not working since 'Reason' is not an element of the list.
also the index is not the same so del list[0] is not a good choice
Any ideas?