I have a list of dicts e.g.
[{\'name\':\'Bernard\',\'age\':7},{\'name\':\'George\',\'age\':4},{\'name\':\'Reginald\',\'age\':6}]
I\'d like to c
I think a list comprehension would do the trick here too.
names = [i['name'] for i in l]
Then use it like so:
'Bernard' in names (True) 'Farkle' in names (False)
Or a one liner (If it's only one check)
'Bernard' in [i['name'] for i in l] (True)