Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python dictionary get keys with condition on value

# credit to Stack Overflow user in source link

[key for key, value in mydict.items() if some_condition_on_value]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #dictionary #keys #condition
ADD COMMENT
Topic
Name
4+3 =