This solution uses map, filter and lambda functions to make it work. But it might be confusing for some. However, it is faster than list comprehension.
list(map(lambda x: x[1], filter(lambda x: x[0]>2, A)))
In short, first the filter function filters out the tuples in A where the first element is greater than 2. Then we take this filtered list and apply a mapping with another lambda function to select only the 2nd element (character).
The result is as desired:
['K', 'J']
Another tool to be aware of is the compress
tool from itertools
, which is also faster than list comprehension. But it returns tuples, so you need to use another map to get only character elements.
from itertools import compress
list(compress(A, map(lambda x: x[0]>2, A)))
Out: [(3, 'K'), (4, 'J')]