I have some tuples: (0,1,2), (3,4,4), (2,2,2) and I would like to find the minimum of the the zero index such that the second index equals 2. I have tried this using the min built-in function but it is giving me a syntax error.
min(data, key=lambda x: x if x[2] == 2)