input_dict = {'ab':12, 'cd':4, 'ef':1, 'gh':8, 'kl':9}
out_dict = 2
Is there any way to find the length of keys of the dictionary, if the values in dictionary are greater than 2 and less than 9?
>Solution :
Try this,
In [61]: len([v for v in d.values() if 2 < v < 9])
Out[61]: 2