What’s the cleanest way to test if a dictionary contains a key? x = {'a' : 1, 'b' : 2} if (x.contains_key('a')): .... 1 Answer 1 Tags: python