There is no need to build a list of keys to check whether a variable is among the keys of a dictionary.