You’d have to search through all dictionaries in your list; use any()
with a generator expression:
any(d['name'] == 'Test' for d in label)
This will short circuit; return True
when the first match is found, or return False
if none of the dictionaries match.
Related Contents:
- How do I sort a list of dictionaries by a value of the dictionary?
- How can I make a dictionary from separate lists of keys and values?
- How can I get list of values from dict?
- How to avoid “RuntimeError: dictionary changed size during iteration” error?
- In Python, when to use a Dictionary, List or Set?
- Pandas DataFrame to List of Dictionaries
- Getting a list of values from a list of dicts
- Converting Dictionary to List? [duplicate]
- How can I convert a dictionary into a list of tuples?
- Dictionary: Get list of values for list of keys
- Create a list with initial capacity in Python
- How do I merge a list of dicts into a single dict?
- How can I make a dictionary (dict) from separate lists of keys and values?
- Access nested dictionary items via a list of keys?
- Check if value already exists within list of dictionaries?
- How to overcome TypeError: unhashable type: ‘list’ [duplicate]
- [] and {} vs list() and dict(), which is better? [closed]
- List of tuples to dictionary [duplicate]
- Appending to list in Python dictionary [duplicate]
- Why can’t I use a list as a dict key in python?
- List of dicts to/from dict of lists
- Python: converting a list of dictionaries to json
- Appending a dictionary to a list – I see a pointer like behavior
- One liner: creating a dictionary from list with indices as keys
- In what case would I use a tuple as a dictionary key? [closed]
- Convert list into a dictionary [duplicate]
- Python: get a dict from a list based on something inside the dict
- Python – sum values in dictionary
- How do I initialize a dictionary of empty lists in Python?
- Mapping dictionary value to list
- Python Array with String Indices
- Remove dictionary from list
- How do I initialize a dictionary of empty lists in Python?
- How can I create an array/list of dictionaries in python?
- how to convert list of dict to dict
- How do I return dictionary keys as a list in Python?
- Why can’t I use a list as a dict key in python? Exactly what can and cannot be used, and why?
- How to check if key exists in list of dicts in python?
- Grouping Python dictionary keys as a list and create a new dictionary with this list as a value
- How to extract all values from a dictionary in Python?
- Check if value already exists within list of dictionaries in Python?
- Sorting a dictionary with lists as values, according to an element from the list
- Tuple list from dict in Python [duplicate]
- How to find length of dictionary values
- How can I convert string values from a dictionary, into int/float datatypes?
- join two lists of dictionaries on a single key
- How to iterate through a list of dictionaries
- Comparing 2 lists consisting of dictionaries with unique keys in python
- Converting a list of tuples into a dict
- How can I save a list of dictionaries to a file?