How do I check that multiple keys are in a dict in a single pass? October 2, 2022 by Tarik Well, you could do this: >>> if all(k in foo for k in ("foo","bar")): ... print "They're there!" ... They're there!