Answers for "python check if list is in dict keys"

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
0

if we use list in the dictionary

if we use list in the dictionary
Posted by: Guest on October-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language