Is there a way to return a list of keys whose inner dict's values match certain criteria
given a python dict:
adict = {
1: {'process':False, 'length':10},
2: {'process':True, 'length':34},
...,
n: {'process': False, 'length: -3'}
}
Is there a way I can get a list of keys [1, 2, 6...] who's inner dict fit the criteria I want?
def somefiltering(critieria1, critieria2, critieria3...):
# for variable number of critieria
# logic
return list of keys
I know I can simply "loop" through my dictionary, but is there a better way? And also
How do I format somefiltering and format criteria1 to make it work?
simply entering criteria1 = "process = True", won't work?