Given:
>>> d = {'a': 1, 'b': 2}
Which of the following is the best way to check if 'a' is in d?
>>> 'a' in d
True
>>> d.has_key('a')
True
Given:
>>> d = {'a': 1, 'b': 2}
Which of the following is the best way to check if 'a' is in d?
>>> 'a' in d
True
>>> d.has_key('a')
True