DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
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
PREVIOUS
NEXT
Tagged:
#python
#test
#list
#dicts
#key
ADD COMMENT
Topic
COMMENT
Name
3+6 =
Submit