I have List of lists like:
[[ac,7,0],[ac,6,1],[ac,5,1],[bc,4,1],[bc,3,0],[ac,2,0]]
I need to get all elements of the first list only if
elem[2] == 1
otherwise, take the all elements of the next list until elem[2] == 1
The result should be:
[ac,6,1]
I'm new in Python, so I don't understand how to do it