Answers for "python test if list of dicts has key"

1

python test if list of dicts has key

>>> lod = [{1: "a"}, {2: "b"}]
>>> any(1 in d for d in lod)
True
>>> any(3 in d for d in lod)
False
Posted by: Guest on December-19-2019

Code answers related to "python test if list of dicts has key"

Python Answers by Framework

Browse Popular Code Answers by Language