I have a dictionary like this
my_d = {"a": [1, 2, 2, 5, 2],"b": [2, 1, 2, 4, 5],"c": [7, 2, 2, 6, 2],"d": [7, 2, 2, 2, 1]}
I am looking for the keys whose dictionary values contain "2 and less than 2" more than twice. In the example, that would be "a","b", "c","d". the following code only find those whose dictionary values contain 2 more than twice:
for key, item in my_d.items():
if item.count(2) > 2:
print key,