我想知道做什么更好:
d = {'a': 1, 'b': 2} 'a' in d True
要么:
d = {'a': 1, 'b': 2} d.has_key('a') True
python dictionary
dictionary ×1
python ×1