So a lot of times I use dictionary for a key/value lookup. But if I need to lookup multiple things, I usually have a for loop for a same. For example:
def check_cond(key):
return True if key in some_dict else False
some_task = [val for val in vals if check_cond(val)]
Is there a better way to search for all vals in one shot rather than this for loop?
Like some_task = fetch_all_conds(vals)
Not sure, if my question makes sense or not?