Use a list comprehension:
[y for x,y in A if x>2]
Demo:
>>> A=[(1,'A'),(2,'H'),(3,'K'),(4,'J')]
>>> [y for x,y in A if x>2]
['K', 'J']
>>>
More Related Contents:
- how to unpack a tuple in this form (‘abc’, [20, 20])? [closed]
- How to sort a list/tuple of lists/tuples by the element at a given index?
- How to merge lists into a list of tuples?
- Sort a list of tuples by 2nd item (integer value) [duplicate]
- Are tuples more efficient than lists in Python?
- Why can tuples contain mutable items?
- How to convert comma-delimited string to list in Python?
- a mutable type inside an immutable container
- Convert tuple to list and back
- How to unzip a list of tuples into individual lists? [duplicate]
- Unpacking a list / tuple of pairs into two lists / tuples
- Append to a list defined in a tuple – is it a bug? [duplicate]
- List of tuples to dictionary [duplicate]
- Explicitly select items from a list or tuple
- How to convert a list to a list of tuples?
- How to find the maximum value in a list of tuples? [duplicate]
- Converting a list of tuples into a dict
- Transform “list of tuples” into a flat list or a matrix
- How to compare a list of lists/sets in python?
- Find an element in a list of tuples
- How to convert list of tuples to multiple lists?
- How to convert nested list of lists into a list of tuples in python 3.3?
- List of Tuples to DataFrame Conversion [duplicate]
- Why can’t I use a list as a dict key in python? Exactly what can and cannot be used, and why?
- How does str.startswith really work?
- Concatenate elements of a tuple in a list in python [duplicate]
- If in Python I put a list inside a tuple, can I safely change the contents of that list? [duplicate]
- How can I convert this string to list of lists? [duplicate]
- In what case would I use a tuple as a dictionary key? [closed]
- Converting string to tuple without splitting characters