How to get a list of values from a list of Dictionary in Python?
thelist = [{'value': 'apple', 'blah': 2}, {'value': 'banana', 'blah': 3}, {'value': 'cars', 'blah': 4}] thisvalues = [d['value'] for d in thelist if 'value' in d] print(thisvalues)
Output
['apple', 'banana', 'cars']