If you just want the first number to match you can do it like this:
[item for item in a if item[0] == 1]
If you are just searching for tuples with 1 in them:
[item for item in a if 1 in item]
More Related Contents:
- How can I add tuples in a list? [closed]
- Search list for number in range
- how to unpack a tuple in this form (‘abc’, [20, 20])? [closed]
- What’s the difference between lists and tuples?
- Why can’t I use a list as a dict key in python?
- How to extract the n-th elements from a list of tuples
- Why can tuples contain mutable items?
- Is there a short contains function for lists?
- List vs tuple, when to use each? [duplicate]
- How to unzip a list of tuples into individual lists? [duplicate]
- Subtracting 2 lists in Python
- Finding index of an item closest to the value in a list that’s not entirely sorted
- Accessing a value in a tuple that is in a list
- How to convert a list to a list of tuples?
- Finding first and last index of some value in a list in Python
- What is the inverse function of zip in python? [duplicate]
- Tuple or list when using ‘in’ in an ‘if’ clause?
- Why is tuple faster than list in Python?
- Most efficient way for a lookup/search in a huge list (python)
- What’s the difference between lists enclosed by square brackets and parentheses in Python?
- Convert a columns of string to list in pandas
- How to flatten a tuple in python
- Fastest way to search a list in python
- Does Python have an immutable list?
- Swap values in a tuple/list inside a list in python?
- Find starting and ending indices of sublist in list
- python – get list of tuples first index?
- Filter a list of tuples based on condition
- How can I convert this string to list of lists? [duplicate]
- In what case would I use a tuple as a dictionary key? [closed]